Make your AI a shadcn expert

Shadcn Button Group

React button group for toolbars and split actions. Built with TypeScript and Tailwind CSS for Next.js using Base UI — fused borders, nested clusters, mixed inputs.

A button group fuses related buttons into one control. Borders collapse, only the outer corners stay rounded, and the focused ring sits on top. Use it for Archive/Report, a split Save, or an input with a search button.

Scroll to load preview...

Looking for a neobrutalism version for shadcn?

Same button group, thicker borders. The NeoBrutalism button group is the kit if you want that look.

Usage

import {
  ButtonGroup,
  ButtonGroupSeparator,
  ButtonGroupText,
} from "@/components/ui/button-group"
<ButtonGroup>
  <Button>Button 1</Button>
  <Button>Button 2</Button>
</ButtonGroup>

orientation is horizontal by default. Nest groups when you want a gap between clusters.

Composition

Button
Button

Orientation

orientation="vertical" stacks them. Borders collapse on the top and bottom.

Scroll to load preview...

Size

size lives on each Buttonsm, default, lg. Match icon-sm / icon / icon-lg on the plus.

Scroll to load preview...

Nested

A ButtonGroup of ButtonGroups gets a gap. Clusters stay fused; the clusters themselves space out.

Scroll to load preview...

Separator

ButtonGroupSeparator between non-outline buttons. Outline already has a border.

Scroll to load preview...

Split

Primary action plus an icon button, separator in the middle.

Scroll to load preview...

Input

The Input stretches. The search button fuses to the end.

Scroll to load preview...

Input Group

Wrap an Input Group when the field needs its own addons.

Scroll to load preview...

Follow plus a chevron that opens extra actions.

Scroll to load preview...

Select

A currency Select fused to an amount input.

Scroll to load preview...

Popover

Copilot plus a chevron that opens a Popover form.

Scroll to load preview...

RTL

Wrap with DirectionProvider and dir="rtl". The back arrow flips.

Scroll to load preview...

API

Prop

Type

ButtonGroupSeparator

Prop

Type

ButtonGroupText

Prop

Type

ButtonGroup is a div with role="group". ButtonGroupSeparator is a Separator.

Notes

Outline already has the divider

Don't drop a ButtonGroupSeparator between outline buttons — you get a double line. For default, secondary, or ghost, the separator is what makes the split readable.

Icon-only groups need aria-label on the ButtonGroup and on each button.

With other components

Questions

Was this page helpful?

Sign in to leave feedback.