All components
Inputs
Switch
A squared on/off toggle — on is a filled yellow track. Controlled or uncontrolled.
Preview
Preview
light
dark
Code
<Switch defaultChecked label="Notifications" />Import from @/components/ui.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | — | Controlled state. |
defaultChecked | boolean | false | Uncontrolled initial state. |
onChange | (v: boolean) => void | — | Change handler. |
label | string | — | Inline label. |