Forms
Navigation & layout
Data display & feedback
Date & time
Browse components
← All components
Switch Group
Stacked switches that share layout.
Install
npx shadcn@latest add https://ui.anuragroy.dev/r/switch-group.jsonPreview
Loading preview…
Installation
Add the component from this site. The shadcn CLI fetches the registry JSON over HTTPS — no named registry submission required.
Terminal
npx shadcn@latest add https://ui.anuragroy.dev/r/switch-group.jsonGitHub fallback if the website is down:
Terminal
npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/switch-group.jsonUsage
Import paths follow your components.json aliases. After install, the default path is @/components/ui/switch-group.
Import
import { SwitchGroup } from "@/components/ui/switch-group"example.tsx
import { Switch } from "@/components/ui/switch"import { SwitchGroup } from "@/components/ui/switch-group"export function Example() { return ( <SwitchGroup className="max-w-xs gap-3"> <label className="flex items-center justify-between gap-4 text-sm"> Wi‑Fi <Switch defaultChecked /> </label> <label className="flex items-center justify-between gap-4 text-sm"> Bluetooth <Switch /> </label> </SwitchGroup> )}API Reference
SwitchGroup
Layout wrapper (`div`) for a list of labeled switches.
| Prop | Type | Default |
|---|---|---|
| className | string | — |