ZeeMeeDesign Exercise

Component

Switch

Sliding-thumb toggle for binary state that commits immediately. Built on Radix Switch.

9:41

Settings row pattern

Use Switch when toggling commits immediately (no submit step). For multi-select where the user confirms a batch, use Checkbox instead. Track is --muted off / --brand on; thumb is white with a soft shadow and slides via the --ease-emphasized token at 200ms.

Props

PropTypeDefaultDescription
checkedbooleanControlled state.
defaultCheckedbooleanUncontrolled initial state.
onCheckedChange(checked: boolean) => voidFires when the user toggles the switch.
disabledbooleanDisabled state (50% opacity, no pointer events).
idstringPair with a <label htmlFor> to make the label a click target.
...RadixSwitchPropsComponentPropsWithoutRef<typeof SwitchPrimitive.Root>All Radix Switch props are forwarded.