Forms
Switch
A toggle for a boolean. Built on Base UI, with the thumb animated between states and the label wired for screen readers.
Import
import { Switch } from "@mikenotthepope/substrateui"With Label
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | false | The controlled checked state of the switch. |
onCheckedChange | (checked: boolean) => void | — | Callback fired when the switch is toggled. |
disabled | boolean | false | When true, prevents interaction with the switch. |