Skip to content

Split Button ​

catnip-split-button is two native buttons in a labelled group, with popup semantics on the suffix button. You render the related action surface, and you own its role, labels, keyboard behaviour, and focus management.

Keyboard ​

  • Both halves are native <button> elements, with disabled mapping directly.
  • The split button renders only the two buttons. Keyboard navigation inside the related action surface is yours.

Consumer-rendered menu ​

The live playground on the Split Button overview page includes a copyable snippet with full menu keyboard support for a catnip-list menu (see Consumer-rendered related actions):

KeyBehaviour
ArrowDown / Enter / Space on focused suffixOpen menu, highlight first enabled row
ArrowDown / ArrowUpMove active row (skip disabled)
Home / EndFirst / last enabled row
Enter / SpaceActivate active row
EscapeClose menu, return focus to suffix
Typeahead (a–z)Jump to next label prefix match

Screen readers ​

PartSemantics
Grouprole="group" with an accessible aria-label describing the group.
Main buttonNative <button> with the default-slot text. While loading, it has aria-busy="true" and both halves are natively disabled.
Suffix buttonNative <button> named by ariaLabelSuffix ("More options" by default). Has aria-haspopup and aria-expanded when popup semantics are enabled; open drives aria-expanded.

Visual ​

  • Meet contrast requirements for text and icons on the button surface (WCAG AA).

What you own ​

  • Main button name: Set splitButtonAriaLabel when the main button is icon-only.
  • Popup state: Pass the controlled open state back to the split button, and keep open, ariaControls, and ariaHaspopup synchronized with the surface you render. Use ariaControls to point to the consumer-rendered popup when it is visible.
  • Action surface: The consumer-rendered action surface should provide the appropriate role, labels, keyboard behaviour, and focus management for its pattern. When you use catnip-list as the related action surface, wire the keyboard support in Consumer-rendered menu.
  • Closing: Close the consumer-rendered surface when the user chooses an item or clicks outside the split-button/menu region.

Catnip Design System by Signicat