Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Data Table
- Date Picker
- Dialog
- Direction
- Drawer
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Kbd
- Label
- Menubar
- Native Select
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle
- Toggle Group
- Tooltip
- Typography
Get Started
import { Bold, Italic, Underline } from "lucide-react"
import {Installation
pnpm dlx shadcn@latest add toggle-group
Usage
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"<ToggleGroup type="single">
<ToggleGroupItem value="a">A</ToggleGroupItem>
<ToggleGroupItem value="b">B</ToggleGroupItem>
<ToggleGroupItem value="c">C</ToggleGroupItem>
</ToggleGroup>Examples
Outline
Use variant="outline" for an outline style.
import {
ToggleGroup,
ToggleGroupItem,Size
Use the size prop to change the size of the toggle group.
import {
ToggleGroup,
ToggleGroupItem,Spacing
Use spacing to add spacing between toggle group items.
import {
ToggleGroup,
ToggleGroupItem,Vertical
Use orientation="vertical" for vertical toggle groups.
import { BoldIcon, ItalicIcon, UnderlineIcon } from "lucide-react"
import {Disabled
import { Bold, Italic, Underline } from "lucide-react"
import {Custom
A custom toggle group example.
Use font-normal to set the font weight.
"use client"
import * as React from "react"RTL
To enable RTL support in StyleDriven UI, see the RTL configuration guide.
"use client"
import * as React from "react"API Reference
See the Base UI Toggle Group documentation.
Deploy your StyleDriven 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