Switch
A toggle switch for binary settings. Accessible and keyboard-operable. Built on Radix UI Switch.
$cookest-ui add switch
Basic
A simple switch with a label.
Settings Panel
Use switches in a settings list for multiple boolean toggles.
Get notified when your meal plan is ready
Receive seasonal recipes every Monday
Use the dark theme across the app
Let Cookest suggest meals based on your history
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | — | Controlled checked state of the switch. |
onCheckedChange | (checked: boolean) => void | — | Callback when the switch is toggled. |
defaultChecked | boolean | false | Default state for uncontrolled usage. |
disabled | boolean | false | Prevents interaction when true. |
id | string | — | ID for pairing with a Label element. |