Weftv0.4.0
GitHubFigma
Blade AI
Actions · ButtonGroupstable

Button group

Joins 2–3 related Buttons into one control: a split button, view options or a small toolbar. Square, flat, items join with a 1px seam.

Preview

#preview

Pick a variant, size and state; Show code opens the React and CSS below.

variant secondary · size medium · 3 buttons
range-switch.tsx
import { ButtonGroup } from "@blade-ai/weft/components/button-group";
import { Button } from "@blade-ai/weft/components/button";

export function RangeSwitch() {
  return (
    <ButtonGroup
      accessibilityLabel="Date range"
      variant="secondary"
      size="medium"
    >
      <Button>Day</Button>
      <Button>Week</Button>
      <Button>Month</Button>
    </ButtonGroup>
  );
}

All states

#all-states

Group-level states, shown on secondary · medium · 3 buttons.

Button group · 9 states · secondary · medium · 3 buttons
Default
Hover (item)
Focus-visible (item)
Disabled (group)
Disabled (single item)
Primary
Tertiary
Vertical
Full width

Props

#props

Booleans are is-prefixed. accessibilityLabel is required. Items are Buttons and follow the Button spec.

Prop
Type
Default
Description
children *
ReactNode (<Button>[])
—
2–3 Buttons, or Button + menu trigger (split). Keep every item the same kind (all buttons or all links).
variant
"primary" | "secondary" | "tertiary"
"primary"
Applied to every item; ghost / link not supported.
size
"xsmall" | "small" | "medium" | "large"
"medium"
Applied to every item. xsmall is not drawn on the sheet.
color
"primary" | "white" | "positive" | "negative"
"primary"
Seam tokens for white / positive / negative: UNDEFINED · needs decision.
isDisabled
boolean
false
Disables every item; an item's own isDisabled can only add, never re-enable.
isFullWidth
boolean
false
Group 100%; items share the width equally.
orientation
"horizontal" | "vertical"
"horizontal"
Sets aria-orientation; vertical is not drawn on the sheet (seam on top).
accessibilityLabel *
string
—
Rendered as aria-label on role="group". A missing label warns in development.
value · onChange
string · (value: string) => void
—
UNDEFINED · needs decision (only if ButtonGroup becomes a toggle group). Not built.

Usage

#usage

Short rules for grouping buttons.

Do
Group only closely related actions (view options, split button, a small toolbar).
Give every group an accessibilityLabel.
Keep one variant and size across the whole group.
Don't
Use ButtonGroup as a tab bar or segmented selector until selection is decided.
Mix variants, sizes, or links and buttons inside one group.
Add gaps or rounded ends; items join with a 1px seam.

Accessibility

#accessibility

Wrapper is role=group; items are native Buttons.

Keyboard
Key
Action
Tab / Shift+Tab
Moves to the next / previous item (tab-through). Disabled items are skipped.
Arrow keys
No effect today. With roving tabindex: ← → (↑ ↓ vertical) move focus. UNDEFINED · needs decision.
Home / End
Only with roving tabindex: first / last item.
Enter / Space
Activates the focused item (Button rules).
ARIA
Element
Role / attribute
When
wrapper <div>
role="group" · aria-label = accessibilityLabel
Always (required)
wrapper <div>
aria-orientation="vertical"
orientation = vertical
wrapper <div>
role="toolbar" for icon toolbars: UNDEFINED · needs decision
Needs roving tabindex
items
<button> / <a> per Button ARIA rules
Always
items (toggle)
aria-pressed: UNDEFINED · needs decision
Only if selection is added
split menu trigger
aria-label · aria-haspopup="menu" · aria-expanded
Split button

Agent Spec

#agent-spec

Machine-readable spec, tables (a)–(g). Same source as /specs/button-group.json and llms.txt.

/specs/button-group.json·component: "ButtonGroup"·package: "@blade-ai/weft"·updated 2026-11-24
PropertyValueToken
Item height28 / 32 / 40 / 48pxsize.28 · 32 · 40 · 48 (from Button)
Item padding-x10 / 14 / 20 / 24pxspacing.16 · 17 · 6 · 7 (from Button)
Gap between items0 (joined)—
Seam width1px, all sizesborder.width.thin
Outer and inner radius0border.radius.none
Focus ring3px on the focused item onlyinteractive.border.primary.faded · border.width.3
Item count2–3 shownmax items: UNDEFINED · needs decision