Switch
A toggle for binary settings with a springy thumb.
Install
npx shadcn add @clearly/switchPreview
Usage
import { Switch } from "@/components/ui/switch"
<Switch />Every Clearly component also accepts glass (subtle·medium·strong), specular and className.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | — | Controlled on/off state. |
defaultChecked | boolean | false | Initial state. |
onCheckedChange | (checked: boolean) => void | — | Change callback. |
size | "default" | "sm" | "default" | Toggle size. |
disabled | boolean | false | Disable the control. |