A row of buttons
Outline buttons side by side share their seams: the edge between two of them is drawn once. Icon buttons, and a column, work the same way.
Buttons, fields and printed cells joined into one row (or column) that share their seams: the edge two neighbors have in common is drawn once, by the one before, or by a pencil separator you put between them.
npx shadcn@latest add @wobko/button-groupFirst time here? Add the registry to components.json first. How to install
Outline buttons side by side share their seams: the edge between two of them is drawn once. Icon buttons, and a column, work the same way.
A printed cell, an input and a button in one row; two highlighter buttons split by a pencil line; a split button. Filled buttons want a separator, since two markers touching would just be one big blot.
The group doing a job: a quantity stepper whose number is a printed cell, a size chooser that is a row of buttons, and a primary action to finish. The status line says what the stepper did.
The shadcn demo: a ButtonGroup of ButtonGroups. A back button, two text buttons, and a Snooze button joined to a menu trigger whose slip has groups, a destructive row and a sub-menu with a radio choice. Groups put a gap between them; each keeps its own seams.
Two groups inside one: five numbered buttons and a previous/next pair. The page you are on is a highlighter button (`aria-current="page"`), the arrows stop at the ends, and the status line says where you are.
A group takes the size of its buttons: give every child the same `size` and the same height, and use the matching square size (`icon-sm`, `icon`, `icon-lg`) for the icon button at the end. Extra small is ours.
A split button the way social apps use it: the main action toggles (Follow / Following, with `aria-pressed`) and the chevron opens every other thing you can do with the conversation. The menu's last row is the destructive one.
A Select trigger, an Input and a Button share seams like any other children, in two groups side by side. The trigger shows only the symbol; the list beneath explains each one. Try changing the currency and sending.
The chevron half of a split button can open anything, not only a menu: here a slip with a text area and a few lines of explanation. The popover is named with aria-label (Radix gives it role=dialog), and focus goes back to the chevron when it closes.
A plain add button, then an InputGroup with a toggle inside it: the group's own box holds the field and the voice button. Turning voice mode on disables the field and changes its prompt; the toggle is `aria-pressed` and lights up as a highlighter.
A role=group flex row. It does not draw anything itself: every child (Button, Input, a Select trigger, ButtonGroupText) is its own hand-drawn host, and the group trims the drawing where they meet: a child that is not first loses its start edge, and one that sits before a ButtonGroupSeparator loses its end edge, so a seam is one stroke, not two. A focused child is never trimmed, so its ring stays whole.
| Prop | Type | Default | Description |
|---|---|---|---|
| orientation | "horizontal" | "vertical" | "horizontal" | Vertical stacks the children and trims their top edges instead. Right-to-left layouts trim the other side. |
| aria-label | string | - | Name the group when the buttons do not explain themselves ("Range", "Text style"). |
A printed cell in the row ("https://", "@", "kg"): a paper-shade body under an ink box, real text in the hand font. Not a control: it has no hover or focus.
| Prop | Type | Default | Description |
|---|---|---|---|
| asChild | boolean | false | Render your own element, e.g. a <label htmlFor>, with the cell's drawing inside it. |
| seed | string | number | - | Pins the hand of this cell. |
A Separator (pencil, vertical by default) that stretches to the group's height and takes the place of the two edges around it. Takes every Separator prop: variant, orientation, decorative.
| Prop | Type | Default | Description |
|---|---|---|---|
| orientation | "horizontal" | "vertical" | "vertical" | Use horizontal in a vertical group. |
The cva function behind ButtonGroup, for laying out another container the same way.
| Prop | Type | Default | Description |
|---|---|---|---|
| orientation | "horizontal" | "vertical" | "horizontal" | Same as ButtonGroup. |
The files the CLI copies into your project.
Loading the source