Skip to content

Split button

Expressive

A primary action beside a trailing button that opens a menu of related actions.

import { SplitButton } from '@windmorph/react';

Keyboard

Split button keyboard
KeyAction
Tab or Shift + TabMoves focus to the leading button, then to the trailing button, then on.
Enter or SpaceRuns the leading action, or follows it when it has href.On the leading button
Enter or Space or Arrow DownOpens the menu with focus on its first item.On the trailing button
Arrow UpOpens the menu with focus on its last item.On the trailing button
Arrow Up or Arrow Down or Enter or EscapeWork as in any Menu: the arrows move between items, Enter chooses one, and Escape closes the menu.In the menu

Screen reader

Role
A group of two buttons side by side (the leading one is a link with href). The trailing button opens a menu.
Accessible name
The leading button is named by its label, or by leadingLabel when it shows only an icon. The trailing button is named by labels.menu ("More options" by default; name it for its menu, as in "More send options"), and the menu is named after it.
States announced
The trailing button reports aria-haspopup and aria-expanded with a menu, aria-expanded alone when it opens its own overlay, and both halves report disabled.
  • The leading icon and the chevron are hidden from assistive tech (aria-hidden).
  • While the menu is open, the rest of the page, the split button included, is hidden from assistive tech.

Focus

  • Both halves are separate Tab stops, leading first.
  • Keyboard focus shows M3's focus indicator on the focused half: a 3px secondary outline 2px outside it. Pointer presses show no ring.
  • The menu takes focus when it opens and gives it back to the trailing button when it closes, as any Menu does. A mouse press opens the menu on release and focuses the trailing button first, so focus still returns there.

Touch target

  • Medium, large and extra-large split buttons (56, 96 and 136px tall) are taller than 48px.
  • At extra-small and small (32 and 40px tall), each half gets its own invisible 48px-tall touch target, at least 48px wide; their layout height stays the same.

Motion

Under reduced motion the press and open morphs snap to their new corners, the chevron turns over at once instead of rotating, and the press ripple appears at full size without growing. Colours still fade.

What you need to do

  • Give labels.menu a name that ties the menu to the main action: "More send options" beside "Send", not "More".
  • Pass leadingLabel when the leading button shows only an icon.
  • Name the group with aria-label only when its buttons need context they lack; it reads as a group of the two either way.
  • Keep the menu to actions related to the leading one.