Sizes
With Label
Disabled
| Prop | Type | Default | Description |
|---|---|---|---|
size | "sm" | "default" | "default" | The size variant of the switch. |
checked | boolean | — | Controlled checked state of the switch. |
defaultChecked | boolean | false | Initial checked state when uncontrolled. |
onCheckedChange | (checked: boolean, eventDetails: SwitchRoot.ChangeEventDetails) => void | — | Event handler called when the checked state changes. |
disabled | boolean | false | Whether the switch is disabled and non-interactive. |
transition | Transition | { type: "spring", stiffness: 500, damping: 22, mass: 0.8 } | Custom Motion spring transition configuration. |