Primitive · CLI
Switch
Soft-rect switch — layout thumb + flex justify flip (Motion.dev Base UI).
Preview
npx shadcn@latest add @atroui/switchDrafts published
State · on
Installation
Agent blurb — install command + no npm UI rule. For agents
npx shadcn@latest add @atroui/switchSource lands in your repo. Installation · Registry
Usage
Switches flip an immediate setting. Always provide an accessible name; keep the thumb travel short and respect reduced motion.
tsx
import { Switch } from "@/components/ui/switch"
<Switch aria-label="Publish drafts" defaultChecked />Try it
Flip checked, disabled, and size with knobs.
size
Switch