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.
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
Orientation
orientation="vertical" stacks them. Borders collapse on the top and bottom.
Size
size lives on each Button — sm, default, lg. Match icon-sm / icon / icon-lg on the plus.
Nested
A ButtonGroup of ButtonGroups gets a gap. Clusters stay fused; the clusters themselves space out.
Separator
ButtonGroupSeparator between non-outline buttons. Outline already has a border.
Split
Primary action plus an icon button, separator in the middle.
Input
The Input stretches. The search button fuses to the end.
Input Group
Wrap an Input Group when the field needs its own addons.
Dropdown Menu
Follow plus a chevron that opens extra actions.
Select
A currency Select fused to an amount input.
Popover
Copilot plus a chevron that opens a Popover form.
RTL
Wrap with DirectionProvider and dir="rtl". The back arrow flips.
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
The actions you fuse
Dropdown MenuChevron for extra actions
InputSearch plus submit
SelectCurrency next to amount
PopoverForm beside the action
Input GroupAddons inside the field
Questions
Related
Was this page helpful?
Sign in to leave feedback.
Button
React button for forms, dialogs, and toolbar actions. Built with TypeScript and Tailwind CSS for Next.js using Base UI — variants, sizes, and buttonVariants for links.
Calendar
React calendar for bookings, filters, and date ranges. Built with TypeScript and Tailwind CSS for Next.js using Base UI — single days, ranges, and locales.