Skip to content
Mosaic
On this page

ActionMenu

A row's "more actions" menu built from a list of actions: an icon trigger that opens a Menu with one item per action. An action with a status keeps the menu open and shows a spinner while pending, then closes it.

Use for

  • a manage menu on a table row or list item
  • a kebab menu of row actions such as revoke or remove
  • a menu item that stays open with a spinner while its action runs

Practices

GuidancePractice
DoPass a label that names the row, such as "Manage jane@example.com".
DoSet status on an action whose work runs inside the menu. Leave it unset for an action that opens a dialog, so the menu closes on click.
DoPass triggerRef from useListRemovalFocus when the action can remove the row.
Don’tGive two actions the same label. It is the item key.

API reference

ActionMenu

Renders nothing when actions is empty. While any action is pending, every item is disabled and the menu ignores close requests.

PropTypeDescription
labelstringAccessible name for the icon trigger.
actionsActionMenuAction[]One item per action: label, onClick, and optional color (neutral or negative), icon and status (idle or pending).
triggerRefRef<HTMLButtonElement>Ref to the trigger button, to restore focus to it.
disabledbooleanDisables the trigger and every item.
focusableWhenDisabledbooleanKeeps the trigger in the tab order while disabled.

Examples

Revoke from a row

TSX
<ActionMenu
  label={fill(m.manage, { name: invitation.email })}
  triggerRef={registerTrigger(invitation.id)}
  actions={[{ label: m.revoke, color: 'negative', onClick: () => onRevokeClick(invitation) }]}
/>