SWITCH
Binary toggle built on Radix UI. Displays [OFF] / [ON] text labels instead of a sliding thumb. Green glow on checked state.
DEPS:@radix-ui/react-switch
PREVIEW
INSTALLATION
USAGE
STATES
OFF
ON
DISABLED OFF
DISABLED ON
CONTROLLED
PROPS
| PROP | TYPE | DEFAULT | DESCRIPTION |
|---|---|---|---|
| label | string | — | Optional text label next to the switch. Auto-generates the id/htmlFor binding. |
| checked | boolean | — | Controlled checked state. |
| defaultChecked | boolean | false | Initial state (uncontrolled). |
| onCheckedChange | (checked: boolean) => void | — | Callback fired on state change. |
| disabled | boolean | false | Disables the switch and reduces opacity. |