ToggleButton
Imports
import {ToggleButton} from 'material-expressive-react';
import {ToggleButton} from 'material-expressive-react/button';
Props
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
| defaultSelected | boolean | No | ||
| disabled | boolean | No | ||
| onSelectedChange | ((selected: boolean) => void) | No | ||
| selected | boolean | No | ||
| shape | enum | round | No | Visual shape at rest. |
| size | enum | medium | No | |
| state | enum | No | Forces a visual state (useful for Storybook). If omitted, the component uses normal browser interactions. | |
| variant | enum | default | No |
Events
This component does not explicitly re-emit DOM events via wrapper props.
Slots
Material Web components frequently use named slots. In React, you can pass slot="..." on children (e.g. <Icon slot="icon" />).
If you need to slot a child component that does not accept a slot prop, use the Slotted utility (see Utilities → Slotted).
Examples
See Storybook for live examples and variants.