Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Card
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Dialog
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Kbd
- Label
- Native Select
- Pagination
- Popover
- Progress
- Radio Group
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle
- Toggle Group
- Tooltip
- Typography
Get Started
@shadcn/react
@shadcn/helpers
Force UI registry
Utilities
Installation#
pnpm dlx shadcn@latest add @force-ui-ember/toggle-group
Usage#
import { ToggleGroup, ToggleGroupItem } from '@/ui/toggle-group';<ToggleGroup @type="single">
<ToggleGroupItem @value="a">A</ToggleGroupItem>
<ToggleGroupItem @value="b">B</ToggleGroupItem>
<ToggleGroupItem @value="c">C</ToggleGroupItem>
</ToggleGroup>Composition#
Use the following composition to build a ToggleGroup:
ToggleGroup
├── ToggleGroupItem
└── ToggleGroupItemExamples#
Outline#
Use @variant="outline" for an outline style.
Size#
Use the @size prop to change the size of the toggle group.
Spacing#
Use @spacing={{2}} to add spacing between toggle group items.
Vertical#
Use @orientation="vertical" for vertical toggle groups.
Disabled#
Custom#
A custom toggle group example.
API Reference#
ToggleGroup#
The main component that wraps toggle group items.
| Prop | Type | Default |
|---|---|---|
@type | "single" | "multiple" | "single" |
@variant | "default" | "outline" | "default" |
@size | "default" | "sm" | "lg" | "default" |
@spacing | number | 2 |
@class | string | |
@disabled | boolean | false |
@value | string | string[] | |
@onValueChange | (value: string | string[]) => void |
ToggleGroupItem#
Individual toggle items within a toggle group. Remember to add an aria-label to each item for accessibility.
| Prop | Type | Default |
|---|---|---|
@value | string | Required |
@class | string | |
@disabled | boolean | false |
Deploy your shadcn/ui app on Vercel
Trusted by OpenAI, Sonos, Adobe, and more.
Vercel provides tools and infrastructure to deploy apps and features at scale.
Deploy to Vercel