Switch

A toggle for binary settings with a springy thumb.

Install

npx shadcn add @clearly/switch

Preview

Usage

import { Switch } from "@/components/ui/switch"

<Switch />

Every Clearly component also accepts glass (subtle·medium·strong), specular and className.

Props

PropTypeDefaultDescription
checkedbooleanControlled on/off state.
defaultCheckedbooleanfalseInitial state.
onCheckedChange(checked: boolean) => voidChange callback.
size"default" | "sm""default"Toggle size.
disabledbooleanfalseDisable the control.