- Docs
- Components
- Switch
Switch
A control that allows the user to toggle between on and off.
Preview
Code
Installation
CLI
Manual
Anatomy
Single import
Multiple imports
Examples
Group
Preview
Code
Form
Component switch-form not found in registry.
API Reference
Switch.Root
| Prop | Type | Default |
|---|---|---|
isSelected | boolean | |
defaultSelected | boolean | |
onChange | function | |
isDisabled | boolean | |
isReadOnly | boolean | |
name | string | |
value | string | |
children | ReactNode |
Switch.Track
| Prop | Type | Default |
|---|---|---|
className | string |
Switch.Thumb
| Prop | Type | Default |
|---|---|---|
className | string |