Switch
Instant on/off. Raw snaps a square block, Silk stretches a soft pill, Volume slides a 3D knob along a raised track.
Needs the @dumb registry in components.json and the style tokens. See Installation.
API reference
Props marked “extra” are Dumb UI additions. Everything else matches shadcn/ui.
Switch
| Prop | Type | Default |
|---|---|---|
| sizeextra | "default" | "sm"Scales the style's switch geometry by 0.78. | "default" |
| checked / defaultChecked | booleanControlled or initial state. | - |
| onCheckedChange | (checked: boolean) => voidCalled on change. | - |
- SpaceEnter
- Toggles the switch.