Integrated ResearchPicasso
Components

Button group

Several buttons that belong to one decision, joined into a single control.

{/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */}

Several buttons that belong to one decision, joined into a single control.

Import

import { ButtonGroup } from "@ir/ui";

Watch out

  • Figma carries a Variant axis; this does not, on purpose. In Figma the group has to restate Outline / Default / Secondary because a component cannot read what its children are. Here the children are Buttons and each one already carries its own variant, so a group-level variant could only duplicate or contradict them. The group owns the geometry; the buttons own their colour. Same divergence the theme-architecture note records for Input's Type axis — the code shape is the contract.

Variants

AxisOptionsDefault
orientationhorizontal · verticalhorizontal

Do and don't

Use Radio, or a segmented control, when the choice persists.

Don't — Use a ButtonGroup for a setting where one option stays selected.

Nothing in a ButtonGroup stays pressed. If the control has to show which option is current, it is answering a question, not offering actions.

Group actions that are variations of one job — Day, Week, Month.

Don't — Join Save, Cancel and Delete because they sit next to each other.

Joining two buttons says they are the same kind of thing. Cancel and Delete are not, and the shared edge makes the destructive one easier to hit by accident.

Use Outline or Secondary for a set of peers, and keep primary for a split of one action.

Don't — Fill a group with primary buttons so everything competes.

A row of five primary buttons has no hierarchy left to offer. The solid treatment is for a group that is really one action plus its options.

Give it an aria-label — "Zoom", "View as", "Export".

Don't — Leave the group without a name.

Read on their own, the buttons are six labels with nothing to say what they have in common. The group's name is what supplies it.

Keep it to a handful, and move the rest behind a menu.

Don't — Join eight buttons into one bar.

A long joined bar stops reading as a set of choices and starts reading as a toolbar, where the shared edges are just noise.

Give each an aria-label, and a tooltip if the icon is not obvious.

Don't — Put bare icon buttons in the group and rely on the shape.

An icon in a joined bar has no label beside it to borrow meaning from, so the name has to come from the button itself.

Accessibility

  • role="group", so the set is announced as one thing — but it needs an aria-label: "Zoom", "View as", "Export". Without one a screen reader reads six buttons with nothing to say what they share.
  • Hover and focus lift a member to z-10 so its focus ring is not clipped by the neighbour's edge.

Where it is drawn

Figma — structure from figma, measurements from figma.

Open in Storybook

On this page