Switch
formsToggle switch with pill track, sliding thumb, label, disabled state, keyboard support (Space/Enter), focus ring, and role=switch with aria-checked. Animated on/off transitions.
Import
typescript
import { Switch } from "packages/ui/src";Props
SwitchProps
| Prop | Type | Required |
|---|---|---|
checked | boolean | No |
onChange | (checked: boolean) => void, label?: string, disabled?: boolean | No |
Examples
Switch
Toggle switch with label, disabled state, keyboard support, and focus ring.
Interactive
States
Settings Panel
Preferences
Email digest
Weekly summary of activity
Auto-save
Save drafts every 30 seconds