Button Group
A connected instrument or frosted segmented tray for related actions — RTL-safe radius surgery, inset dividers, hover seam elevation, and composition with inputs and dropdowns.
Installation#
pnpm dlx shadcn@latest add @davinciui/button-groupUsage#
Composition: Wrap Button, input, or select inside ButtonGroup. Use ButtonGroupSeparator for dividers and ButtonGroupText for static text/icons.
Accessibility: Group has role="group" semantics; ensure each button has discernible text and aria-label for icon-only buttons.
ButtonGroup vs ToggleGroup: Use ButtonGroup for collective actions (e.g., toolbar). Use ToggleGroup when buttons maintain selected state.
Composition#
Segmented#
Toolbar#
Orientation#
Size#
Nested#
Separator#
Split#
Input#
Input Group#
Select#
Popover#
RTL#
Composition#
Use the following composition to build a Button Group:
ButtonGroup
├── Button
├── Input / Select
├── ButtonGroupSeparator
└── ButtonGroupTextAPI Reference#
| Prop | Type | Default |
|---|---|---|
variantConnected shares edges as one instrument; segmented is a frosted tray for distinct controls. | "connected" | "segmented" | "connected" |
orientationOrientation of the group. Sets aria-orientation when vertical. | "horizontal" | "vertical" | "horizontal" |
classNameAdditional CSS classes. | string | — |
ButtonGroupSeparatorVisual separator between grouped buttons. | Component | — |
ButtonGroupTextText container within a button group (e.g., for icons or labels). | Component | — |
Accessibility#
The wrapper is a role group with aria-orientation for vertical layouts and aria-hidden separators. Keyboard behavior is inherited entirely from child buttons; the group adds no roving focus or key handling.
Motion#
Static layout primitive with no animation of its own. Hover and focus only raise a child's z-index, and the lone motion-reduce:transition-none class has no transition to disable.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

