--- title: Toggle Group description: Provides a shared state to a series of toggle buttons. --- ## Installation CLI Manual ```bash npx shadcn@latest add @coss/toggle-group ``` Install the following dependencies: ```bash npm install @base-ui/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage ```tsx import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group" ``` ```tsx Bold Italic Underline ``` ## API Reference ### ToggleGroup Root component. Styled wrapper for `ToggleGroup.Root` from Base UI. Provides shared variant and size to child toggles via context. | Prop | Type | Default | Description | | --------- | ----------------------------- | ----------- | ------------------------------------------------ | | `variant` | `"default" \| "outline"` | `"default"` | Controls the styling of all child toggles | | `size` | `"default" \| "sm" \| "lg"` | `"default"` | Controls the size of all child toggles | ### ToggleGroupItem Individual toggle button within the group. Styled wrapper for `Toggle` from Base UI. Inherits variant and size from parent ToggleGroup context. ### ToggleGroupSeparator Visual separator between toggle buttons. ## Examples ### Small Toggles ### Large Toggles ### With Outline Toggles ### Vertical ### Disabled ### With Disabled Toggle ### Multiple selection ### With Tooltips ## Changelog - [Mar 20, 2026](/ui/docs/changelog#toggle-group) — `Toggle` renamed to `ToggleGroupItem`