Switch
Markdown for agentsToggle switch for binary settings, with role=switch and aria-checked.
npx slipstream-ui@latest add switchUsage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| checked | boolean | — | Controlled on/off state. |
| onCheckedChange | (checked: boolean) => void | — | Fired when the user toggles the switch. |
| disabled | boolean | false | Disables the switch. |
Accessibility
- role="switch" with aria-checked announces on/off state.
- Space and Enter toggle the switch.