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 switch

API

PropTypeDefaultDescription
checkedbooleanControlled on/off state.
defaultCheckedbooleanfalseInitial state when uncontrolled.
onCheckedChange(checked, eventDetails) => voidFires as the state commits (also triggers the haptic tick).
disabledbooleanfalseDisables the switch.

Plus all Base UI Switch.Root props (e.g. name, required for forms).

Notes

  • While pressed the thumb stretches toward the far side (the iOS feel) and snaps across on release.
  • The thumb is a layout element — the crossing spring is interruptible mid-flight.

Press feedback, reduced motion, and haptics follow the global policy — see Motion and Haptics.