Appearance
Action discovery
Where actions live and which control shows them, so people find every action without hunting behind an unlabelled icon.
contextmenuactions-contextmenuactionsshell--split-button-openOpen in Storybook ↗When it applies
- Every place that offers actions on an entity: the detail page header, a panel on the detail page, a list row, a selection of list items, and an empty result list.
- Not for the save and cancel of a form or an editor: those belong to the form itself (see Per-field editing and Dynamic form).
How it works
Actions sit where their subject is. The control then needs no extra words to say what it acts on.
- The detail page header holds the record's actions, plus its Delete (a danger button), History and, when configured, Edit metadata.
- A panel holds the actions on that panel's entity in its header.
- A list row holds the actions on that row: a ⋮ under the list's Actions column header, next to its icon buttons such as preview.
- A selection of list items gets its actions in the selection action bar. A list's create action moves next to the page title as a primary pill.
- An empty result can offer actions under the no results message, such as creating the missing entity.
The configuration decides the control, by how many actions are promoted. People get the same shape for the same situation everywhere. An action is promoted when its configuration sets
showAsButton(for the actions on an empty result list:primary).Promoted actions Other actions Control none one or more labelled overflow menu: Actions ▾ one none a plain primary button one one or more a split button: the promoted action plus a chevron for the rest more than one any the first is the split button's primary; the others lead its menu One primary per subject. Two primaries compete for the same click; further promoted actions move to the top of the menu instead.
A trigger is never a bare ⋮, except on a list row, where the column header names it, and on screens below 48rem, where every menu becomes a ⋮ that opens as a bottom sheet. The ⋮ always keeps an accessible name.
Selection actions are all visible. In the selection action bar every action is its own button. Only actions that open a submenu stay behind an Actions menu; on a small screen more than one action folds into a ⋮.
Destructive actions are marked by configuration and go last. The action's
tone: Dangergives it--color-danger-inkand sorts it to the end of a menu or of the selection bar. The verb in the label is never used to guess.An action that does not apply now stays visible, disabled, with its reason. This applies to selection actions: when the selection is empty, too small, too large or of mixed types, the button or menu item is disabled and its tooltip says what to do, such as Select at least 2 items to use this action. An action that never applies to this record is left out by its configuration (
hidden, or a metadata condition).
Components
| Component | Role in this pattern |
|---|---|
| Button | a single promoted action; every selection action; disabled with a reason |
| Split button | one promoted action with the rest under its chevron |
| Overflow menu | the labelled Actions menu, the row ⋮ and the small-screen sheet |
| Selection action bar | the actions on the selected items of a list |
| Entity list element | the list row that holds the row ⋮ and the Actions column |
| Panel & block shells | the panel header that holds a panel's actions |
| Tooltip | the reason on a disabled action |
Keyboard & accessibility
- Every trigger is a real button reachable with Tab. Menus follow the menu button keys: ↓ opens, ↑ and ↓ move, Home and End jump, Escape closes and returns focus to the trigger. See Overflow menu.
- A trigger that knows its subject says so: Actions for {title}, More actions for {title}. A row passes its first value as the title, a panel its heading.
- A disabled action with a reason stays focusable (
aria-disabled="true"), so keyboard and screen-reader users can reach the reason. - A selection action carries the count in its name: Delete (2 selected).
Content
- Labels start with a verb, in sentence case: Open record, Export to CSV, Delete.
- A menu with one clear subject names it instead of Actions: Saved searches.
- A disabled reason says what to do, not what is wrong.
- Translation keys:
contextMenu.actions,contextMenu.actions-for,contextMenu.more-actions,contextMenu.more-actions-forandtooltip.bulkOperations.*.
Related
Split button · Overflow menu · Selection action bar · Button · Feedback