Button Group
Welds adjacent controls into one unit: the inner corners square off and the touching borders collapse to a single seam, so a row of buttons reads as one control instead of a row of pills.
It welds whatever you put in it — buttons, an input plus a button, a select plus a button — which is what makes it the primitive behind attached actions, split buttons, and search fields.
<x-wirekit:: is the same weld under the
button's name: the two take the same props and draw from the same rules. This page is the one
to start from, and either tag works.
Basic Usage
Each button is an action of its own. Left, center and right for text alignment are one choice among three, which is a segmented control.
Split button
A primary action welded to a menu of secondary ones — the canonical use.
Search field
An input welded to its button. The group squares the seam; the input keeps its own border and focus ring.
Vertical
Stacking on a narrow screen
A group holds one shape at every width, so a row that fits on a desktop can run off a phone.
stack-below names the width under which the group becomes a column, welded on the block axis
there, its buttons stretched to one width, and welded on the inline axis from that width up.
The breakpoint names are the ones hide-below takes on a table column: sm, md, lg, xl
and 2xl. A vertical group ignores the prop, because it already stacks at every width.
Not a toolbar
Button Group is a visual weld: every control inside stays individually Tab-reachable, which is what people expect from attached buttons.
If you want a roving keyboard model — one Tab stop for the whole cluster, arrow keys to move between controls — that is Toolbar. Reach for it when the cluster is a dense bar of many controls.
Related: Segmented Control is the right choice when the buttons are mutually-exclusive options rather than separate actions.
Input addons
For a text affix or an icon inside a single field — https://, $, @, a
search glyph, a clear or copy button — you do not need a group.
Input already takes prefix / suffix (and clearable /
copyable) inside one shared border and focus ring.
Use Button Group when you are welding separate controls together.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
label |
string|null | null |
Accessible name for the group |
orientation |
string | 'horizontal' |
horizontal or vertical |
stackBelow |
string|null | null |
'sm', 'md', 'lg', 'xl' or '2xl' — the width under which a horizontal group becomes a column. A vertical group ignores it. See Stacking on a narrow screen |
scope |
string|null | null |
Scoped personalization name |
Accessibility
- The group is
role="group"; give it alabelso assistive technology can announce what the cluster is for. - Every control stays Tab-reachable — no roving tabindex. That is Toolbar's job.
- A focused control is lifted above the collapsed seam (
z-index), so its focus ring is never clipped by its neighbor — a weld must not cost focus visibility (WCAG 2.4.7). - Icon-only children still need their own
aria-label. - RTL mirrors for free. The weld uses CSS logical properties
(
border-start-start-radius,margin-inline-start), so it flips correctly underdir="rtl"with no extra rules and no separate stylesheet.
Keyboard Interaction
| Key | Action |
|---|---|
| Tab | Move to the next control in the group |
| Enter / Space | Activate the focused control |
Pitfalls
- Do not use it for mutually-exclusive options — that is Segmented Control.
- Do not use it for a dense control bar — that is Toolbar, which brings the roving keyboard model.
- Do not reach for it for a text affix — Input's
prefix/suffixalready share one border. - Do not expect it to wrap — its buttons share their borders, so a group stays on one line.
Keep it to a few actions, and give it
stack-belowwhere they run off a phone: it becomes a column under the width you name. More actions than a column holds well belong in a Toolbar, which wraps, or in a Row —<x-wirekit::row wrap="responsive">holds one line where there is room and wraps where there is not.
Design Tokens
| Element | Token |
|---|---|
| Seam width | --border-wk-width (the collapse is a negative margin of exactly this) |
| Corner radii | inherited from the welded children |