StartFoundationsComponentsContent

Button group

A button group joins related buttons into one block, or spaces them evenly. Each button stays its own action; the group holds no value.

Stable Figma
OverviewUsageAPIAccessibility
Left Center Right
<tk-button-group label="Text alignment">
  <tk-button>Left</tk-button>
  <tk-button>Center</tk-button>
  <tk-button>Right</tk-button>
</tk-button-group>

Anatomy

Part What it is
tk-button-group the element; role="group"; a row or a column
default slot two or more tk-button or tk-icon-button; each keeps its own label, variant, and tone
end caps the outer corners of the first and last button
seams square inner corners and a 1px line between joined buttons

Layout

Joined and spaced

By default the buttons join into one block. The group squares the inner corners and draws the line between buttons, so any variant works. Add spaced for separate buttons with an 8px gap, such as Save and Cancel. A joined row's corners assume left-to-right, so use spaced in a right-to-left layout.

Save changes Cancel
<tk-button-group spaced label="Form actions">
  <tk-button variant="primary">Save changes</tk-button>
  <tk-button>Cancel</tk-button>
</tk-button-group>

Orientation

orientation="vertical" stacks the buttons in a column, all as wide as the widest.

Edit Duplicate Archive
<tk-button-group orientation="vertical" label="Row actions">
  <tk-button>Edit</tk-button>
  <tk-button>Duplicate</tk-button>
  <tk-button>Archive</tk-button>
</tk-button-group>

Shape

Set shape="round" on the group, not on the buttons. The end caps round into a pill and the middle corners stay square. A vertical block gets 16px caps instead. In a spaced group, every button becomes a pill. A button's own shape has no effect in a joined group.

25% 50% 100%
<tk-button-group shape="round" label="Zoom">
  <tk-button>25%</tk-button>
  <tk-button>50%</tk-button>
  <tk-button>100%</tk-button>
</tk-button-group>

Sizes

Previous Next
<tk-button-group size="small" label="Pages">
  <tk-button>Previous</tk-button>
  <tk-button>Next</tk-button>
</tk-button-group>

Set size once on the group and every button takes it: small, medium, or large, 24, 32, or 36px tall, like Button. Without it, each button keeps its own size. Don't mix sizes in a joined block.

States

Previous Next
<tk-button-group disabled label="Pages">
  <tk-button>Previous</tk-button>
  <tk-button>Next</tk-button>
</tk-button-group>
  • disabled: disables every button. A button you disabled on its own stays disabled when the group is enabled again. You can also disable single buttons.
  • Hover, press, and focus belong to each button. In a joined block the focused button comes to the front, so its focus ring is never cut off.