Switch
Bindable binary switch with visible or aria-only labeling.
Loading interactive example
Use Switch for a setting that takes effect as soon as it changes. The thumb keeps the same inset in both states. The thumb moves on the base motion step. Reduced motion changes its position immediately.
API
| Member | Type | Kind | Required | Default |
|---|---|---|---|---|
ariaLabel | string | prop | No | undefined |
checked | boolean | binding | No | false |
disabled | boolean | prop | No | false |
label | string | prop | No | undefined |
onCheckedChange | (checked: boolean) => void | callback | No | undefined |
size | ControlSize | prop | No | 'md' |
Examples
Source
Loading source