Switch
A flat toggle — pastel mint track when on, white when off, with a lemon knob that has a thick navy border.
switch-demo.app
Installation
terminal.sh
npx y2kui@latest add switchUsage
import { Switch } from "@/components/ui/switch";Props
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | — | Controlled checked state. |
defaultChecked | boolean | — | Initial checked state (uncontrolled). |
onCheckedChange | (checked: boolean) => void | — | Fired when the switch state changes. |
disabled | boolean | false | Disable the switch. |