Toggle switch for binary settings, with role=switch and aria-checked.

npx slipstream-ui@latest add switch
Usage

Props

PropTypeDefaultDescription
checkedboolean—Controlled on/off state.
onCheckedChange(checked: boolean) => void—Fired when the user toggles the switch.
disabledbooleanfalseDisables the switch.

Accessibility

  • role="switch" with aria-checked announces on/off state.
  • Space and Enter toggle the switch.