Switch

UI

Toggle switch for binary on/off settings. Always pill-shaped regardless of theme radius.

[EXAMPLES]

Interactive
[DISABLED]

[PROPS]

PROPTYPEDEFAULTDESCRIPTION
checkedbooleanControlled checked state
onCheckedChange(checked: boolean) => voidToggle callback
disabledbooleanfalseDisable the switch

[ACCESSIBILITY]

KEYBOARD SHORTCUTS

KEYACTION
SpaceToggle the switch

ARIA

  • >role="switch"
  • >aria-checked reflects state