Toggle groupNew
On/off choices side by side whose fills merge: two pressed toggles next to each other square off their inner corners and read as one shape.
Used forText formattingFiltersDays of the weekView options
Install with the shadcn CLI
Templates
Need the whole page?
43 Next.js landing pages, each designed from scratch. Try any of them live; one is $39, all of them $99, and 5 are free.
Where it’s used
Text formatting
Bold, italic, underline together.
Filters
Several categories on at once.
Days of the week
Pick the days a schedule runs.
View options
Show grid, show rulers.
What it handles for you
Multi-select toggles need to show which are on and how they relate; merging adjacent fills does that with no extra UI.
Merging fills
Inner corners ease from round to 4px (320ms).
aria-pressed
Each toggle is a real pressed button.
Icons or words
iconOnly options keep their label as the name.
Toggle
A single pressed/unpressed button with the same look.
Overview
Toggle groups usually show each pressed button as its own pill, so Bold and Italic look like two blobs. Here pressed neighbours join: the corners between them ease square, so they read as one shape. A single Toggle is exported too.
States
- press
- The fill fades in (220ms); it gives under the finger.
- merge
- Corners shared with a pressed neighbour square off (320ms).
Usage
Props
| Prop | Type | Description |
|---|---|---|
| options | ToggleOption[] | value, label, icon, iconOnly, disabled. |
| value / defaultValue | string[] | Pressed values. |
| onValueChange | (value: string[]) => void | Called on change. |
| label | string | Accessible name. |
| size | "sm" | "md"default "md" | 28px or 36px bar. |
| Toggle | { pressed, defaultPressed, onPressedChange } | One toggle button. |
Accessibility and motion
- For one choice, use the segmented control.
- Reduced motion: fills and corners change at once.
Requirements
React 19, Tailwind CSS v4 and shadcn/ui theme variables (any style, light and dark). Icons from lucide-react.
The CLI also installs ui-interaction-motion.
Source
Registry item: /r/toggle-group.json


