Switch
A toggle switch component for binary on/off states, often used for settings and preferences.
Installation
npx chilli@latest add switchDefault
API Reference
Switch
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | The label text for the switch. |
checked | boolean | — | Controlled checked state. |
defaultChecked | boolean | false | Initial checked state for uncontrolled usage. |
disabled | boolean | false | Whether the switch is disabled. |
onCheckedChange | (checked: boolean) => void | — | Callback when the checked state changes. |