Components/Switch
Component

Switch

Controlled or uncontrolled toggle switch with smooth thumb animation.

Use for on/off preferences. Works uncontrolled by default or pass `checked` + `onCheckedChange` for controlled use.

Install from registry

npx shadcn@latest add https://ui.comcreate.io/r/switch.json

Shadcn-compatible registry endpoint served locally for copy-paste installs.

Installed files

  • components/ui/switch.tsx
  • lib/utils.ts