StartFoundationsComponentsContent

Split button

A split button joins a default action to a caret that opens a menu of alternatives. The default runs in one click; the rest wait behind the caret.

Stable Figma
OverviewUsageAPIAccessibility
Merge pull request Squash and merge Rebase and merge
<tk-split-button variant="primary" trigger-label="More merge options">
  <tk-button slot="action">Merge pull request</tk-button>
  <tk-menu slot="menu" label="Merge options">
    <tk-menu-item>Squash and merge</tk-menu-item>
    <tk-menu-item>Rebase and merge</tk-menu-item>
  </tk-menu>
</tk-split-button>

Anatomy

Part What it is
tk-split-button the element; groups the two segments
action slot the default action: a tk-button, on the left; its own Tab stop
divider part the 1px line between the segments
caret a chevron icon button the split button adds for you; its own Tab stop
menu slot a tk-menu with items only; the caret opens it

Composition

Put a tk-button in the action slot and a tk-menu with only its items in the menu slot. Don't write a trigger: the split button adds the caret and wires it to the menu. It passes variant, size, disabled, and loading to both segments, so set them on tk-split-button, not on the parts.

Listen for click on the action button and on each tk-menu-item.

Variants

Publish Schedule Export Export as PDF
<tk-split-button variant="primary" trigger-label="More publish options">
  <tk-button slot="action">Publish</tk-button>
  <tk-menu slot="menu" label="Publish options"><tk-menu-item>Schedule</tk-menu-item></tk-menu>
</tk-split-button>
<tk-split-button trigger-label="More export options">
  <tk-button slot="action">Export</tk-button>
  <tk-menu slot="menu" label="Export options"><tk-menu-item>Export as PDF</tk-menu-item></tk-menu>
</tk-split-button>
  • primary: the main action of a view. Use one per view.
  • secondary (default): every other split button.

There is no ghost and no danger split button.

Shape

shape="round" gives the block pill ends. The seam between the segments stays square.

Save Save as copy
<tk-split-button shape="round" trigger-label="More save options">
  <tk-button slot="action">Save</tk-button>
  <tk-menu slot="menu" label="Save options"><tk-menu-item>Save as copy</tk-menu-item></tk-menu>
</tk-split-button>

Sizes

Small Duplicate Large Duplicate
<tk-split-button size="small" trigger-label="More options">
  <tk-button slot="action">Small</tk-button>
  <tk-menu slot="menu" label="Options"><tk-menu-item>Duplicate</tk-menu-item></tk-menu>
</tk-split-button>
<tk-split-button size="large" trigger-label="More options">
  <tk-button slot="action">Large</tk-button>
  <tk-menu slot="menu" label="Options"><tk-menu-item>Duplicate</tk-menu-item></tk-menu>
</tk-split-button>

small, medium (default), and large are 24, 32, and 36px tall, the same as Button, so a split button lines up with other buttons in a toolbar.

States

Publish Schedule Publish Schedule
<tk-split-button disabled trigger-label="More publish options">
  <tk-button slot="action">Publish</tk-button>
  <tk-menu slot="menu" label="Publish options"><tk-menu-item>Schedule</tk-menu-item></tk-menu>
</tk-split-button>
<tk-split-button variant="primary" loading trigger-label="More publish options">
  <tk-button slot="action">Publish</tk-button>
  <tk-menu slot="menu" label="Publish options"><tk-menu-item>Schedule</tk-menu-item></tk-menu>
</tk-split-button>
  • disabled: disables both segments.
  • loading: the action shows a spinner and ignores repeat clicks; the caret is disabled until loading ends.