Switch
Turns a single setting on or off. The change takes effect right away.
components/ui/switch.tsx
Preview
Code
Installation
npx betterone-ds add switchProps
| Prop | Type | Default |
|---|---|---|
| defaultSelected | boolean | false |
| isSelected | boolean | — |
| isDisabled | boolean | false |
| size | "default" | "sm" | "default" |
Accessibility
- Use a switch for on or off settings. Use a checkbox when the change needs a submit step.
- Write the label as the setting name, such as "Email notifications".

