Switch

Turns a single setting on or off. The change takes effect right away.

components/ui/switch.tsx

Installation

npx betterone-ds add switch

Props

PropTypeDefault
defaultSelectedbooleanfalse
isSelectedboolean—
isDisabledbooleanfalse
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".