Switch
A control that toggles between on and off. The thumb springs across the track with real physics.
tsx
import { Switch } from "@/registry/seam/ui/switch"
export default function SwitchDemo() {
return (
<label className="flex items-center gap-2 text-sm">
<Switch defaultChecked />
Airplane mode
</label>
)
}bunx --bun @seamui/cli@latest add switchAPI
| Prop | Type | Default | Description |
|---|---|---|---|
| checked | boolean | — | Controlled on/off state. |
| defaultChecked | boolean | false | Initial state when uncontrolled. |
| onCheckedChange | (checked, eventDetails) => void | — | Fires as the state commits (also triggers the haptic tick). |
| disabled | boolean | false | Disables the switch. |
Plus all Base UI Switch.Root props (e.g. name, required for forms).