ButtonGroup
A component that groups multiple buttons together within a glass-like container with separators between items.Import
Components
ButtonGroup
The container component that wraps ButtonGroupItem elements.The size of all buttons in the group.Options:
xs- 28px height (var(—space-28))s- 32px height (var(—space-32))m- 36px height (var(—space-36))l- 40px height (var(—space-40))
ButtonGroupItem components to display in the group.
Additional CSS classes to apply to the group container.
Explicit escape hatch for intentional structural overrides.
ButtonGroupItem
Individual button within a ButtonGroup.Icon element displayed before the button text.
Icon element displayed after the button text.
Position within the group (automatically set by ButtonGroup).Options:
only- Single item (fully rounded)first- First item (rounded left, border right)middle- Middle item (no rounding, border right)last- Last item (rounded right)
Color tone applied to the item.Feedback tones:
default,info,warning,danger,success
red,orange,amber,yellow,lime,green,emeraldteal,cyan,sky,blue,indigo,violet,purplefuchsia,pink,rose
Text label for the button.
When true, disables interaction and applies disabled styling.
Additional CSS classes to apply to the item.
Explicit escape hatch for intentional structural overrides.
Usage
Basic Button Group
Sizes
With Icons
Icon-Only Items
With Tone
Single Item
With Click Handlers
Behavior
- Items automatically receive proper border radius based on position
- Items between other items get a right border separator
- Active state on items scales the content wrapper (0.94) for tactile feedback
- The group container has a glass-like appearance with backdrop blur
- Size is controlled at the group level and applies to all items
Accessibility
- The group container uses
role="group"for semantic grouping - Built on Base UI’s
Buttonprimitive with full keyboard support - Focus ring appears on individual items with proper z-index
- When using icon-only items, always provide
aria-label - Disabled items use
cursor-not-allowedand reduced opacity
Design Tokens
The ButtonGroup components use the following design tokens: Colors:actions-tertiary-default,actions-tertiary-hover,actions-tertiary-disabledcontent-strong,content-disabledborder-interactive-default(for separators)
- Heights:
space-28,space-32,space-36,space-40 - Horizontal padding:
space-10,space-12,space-16 - Gap between elements:
space-2,space-4 - Icon sizes:
space-16,space-18
- Border radius:
radius-max(fully rounded) - Font weight:
font-weight-medium - Focus ring:
utility-focus-inner,utility-focus-outer - Shadows:
utility-shadow-l1,utility-shadow-l2,utility-shadow-l3 - Backdrop blur:
12px