Skip to content
GitHub (opens in a new tab)

ButtonGroup

Joined row of kit Buttons that share one size and act as one control cluster.

stableMoleculecontracts/buttongroup.json

Preview

ButtonGroup

Joined row of kit Buttons. Same size. Only kit Buttons. One primary per view.

Master

Three medium outline Buttons in one joined row.

Usage

Only wrap kit Buttons. Keep the same size in a row. Do not invent a local segmented control. Still one primary per view.

Do's

  • Related sibling actions such as a view switch
  • Split confirm/cancel pairs that should read as one cluster
  • A toolbar of same-size Buttons

Don'ts

  • Unrelated actions that should stay separate Buttons
  • Wrapping non-Button controls
  • Nesting groups
  • paging a list — use Pagination
<ButtonGroup ariaLabel="Plan period">
  <Button appearance="outline" mode="neutral" size="md">Day</Button>
  <Button appearance="outline" mode="neutral" size="md">Week</Button>
  <Button appearance="outline" mode="neutral" size="md">Month</Button>
</ButtonGroup>

When to use

  • Related sibling actions such as a view switch
  • Split confirm/cancel pairs that should read as one cluster
  • A toolbar of same-size Buttons

When not to use

  • Unrelated actions that should stay separate Buttons
  • Wrapping non-Button controls
  • Nesting groups
  • paging a list — use Pagination

What an agent reads

import { ButtonGroup } from "agentic-ds-kit";
must
  • role=group
  • optional aria-label names the group
  • Buttons keep their own names
defaults
Nothing extra in the contract.
stops if
  • Do not invent a local button group / segmented control
  • Do not mix sizes inside one group
  • Do not put more than one appearance=solid mode=primary Button, IconButton or SplitButton in a group (or the view)
  • Do not wrap Input, Select, or anything except kit Button, IconButton or SplitButton
  • Do not use raw hex

From contracts/buttongroup.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
childrennodeYes—only kit Button nodes, same size, 2+
ariaLabelstringNo—names the group
  • Component
    →

    Button

    Clickable action control with appearance × mode (plus an optional flat set) and a fixed set of sizes.

  • Component
    →

    Pagination

    Page navigation with previous, next, page numbers, and ellipsis, plus optional first/last, a rows-per-page Select and a page or results status for table footers.

  • Component
    →

    Cell

    Inline cell content for datasets: text, link, avatar, file, payment, badge, trend, avatar group, select, progress, rating, or row actions, with optional checkbox.

  • Pattern
    →

    Empty first run

    A new billing workspace with no invoices: one Create invoice, opt-in sample data and a one-line setup status.