Switch
Buttons
An accessible animated toggle switch with spring thumb animation, size variants, label support, and keyboard interaction.
Loading preview...
Customize
Size:
Checked
Label
Disabled
Props
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | false | Whether the switch is checked. |
onChange | (checked: boolean) => void | undefined | Callback when the switch is toggled. |
label | string | undefined | Label text displayed next to the switch. |
size | 'sm' | 'md' | 'lg' | 'md' | Size variant of the switch. |
disabled | boolean | false | Disables the switch. |
className | string | '' | Additional CSS classes. |