Action menu
An action menu is a small list of actions that opens when someone taps a button.
Overview
Use an action menu to keep related actions in one place without crowding the screen. People open it with a button (the trigger), pick an action, and the menu closes.

Anatomy
Trigger: the button that opens the menu. It is the Button component, so any button type and size works, and the label is optional.
Menu: the container that holds the items.
Item: one action, with a label and an optional leading icon.
Divider: a line that separates groups of items.
Do and Dont
Do

Keep related actions together and use dividers to separate distinct groups.
Dont

Placing unrelated actions in one continuous list without clear grouping.
Do

Place the most frequently used actions near the top of the menu.
Dont

Don't make people scan the entire menu to find actions they use most often.
Do

When an action is disabled and the reason isn't obvious, explain why it can't be used.
Dont

Leave people guessing why an action is unavailable.
Trigger

The trigger is the Button component. Any button type works, but the recommended use is using either secondary, or ghost for an icon-only trigger with an ellipsis or other icon.
An icon-only trigger needs an accessibility label, like More actions.
While the menu is open, the trigger stays highlighted.
Alignment and placement

The menu can be aligned to the left or the right edge of the trigger, and can open below or above it. That gives 4 combinations:
Below, aligned left
Below, aligned right
Above, aligned left
Above, aligned right
When to use: open below and align to the edge that has the most room. Open above when the trigger is near the bottom of the screen.
Destructive

An action that deletes something or can't be undone, or one that people may not want to do by accident, like Log out. The text and the icon are red.
When to use: for actions with a destructive or irreversible effect.
When not to use: for any action that isn't destructive.
Destructive items go last, after a divider.
The hover look is the same as the default item. This shows that both are part of the same menu. Only the red text and icon are different.
States
An item has no focus state. On desktop, only the trigger shows a focus ring.
Default

The item is ready to be chosen.
Hover

The pointer is over the item. The hover look is also used to show which item is selected when someone moves through the menu with the keyboard. So on desktop, hover and keyboard focus look the same.
Clicked

The item is being pressed. It gives immediate feedback that the choice was registered.
This state matters most on mobile. There is no hover and no keyboard there, so the clicked state is the only way to show that a tap worked. It also helps when the action takes time, because it tells people that they've done their part and only need to wait.
Disabled

The item can't be chosen.
When to use: when the action exists but isn't available right now.
When not to use: when the reason isn't clear. If someone can't tell why an item is disabled, explain it nearby.
Rules and behaviors
Layout
The menu opens below the trigger, aligned to its left or right edge.
If there isn't enough room below, it opens above.
The menu shifts sideways if needed so it stays inside the screen.
The width is at least 200. It hugs the longest item, up to 280. Longer labels are cut off with an ellipsis.
The height grows with the items, up to the screen height minus a margin of 16. After that, the list scrolls inside the menu.
Behavior
Choosing an item runs its action and closes the menu.
There is no selected state, because the menu is for actions, not for choosing a value.
Disabled items can't be chosen.
Pointer and touch
On desktop, hover shows when the pointer is over an item.
On touch screens there is no hover. The clicked state shows when someone taps an item.
Keyboard
Enter or Space on the trigger opens the menu. The first item is highlighted with the hover look.
The up and down arrow keys move between items.
Enter chooses the highlighted item.
Escape closes the menu and returns focus to the trigger.
Tab closes the menu and moves focus to the next element on the page. It doesn't move between items.
Best practice
Start labels with a verb when the action changes something, like Invite colleagues.
Use icons on all the items in a menu, or on none of them. A mix looks uneven.
Keep related actions in the same group, and keep the groups small.
For actions that take time, make sure the clicked state is visible before the menu closes, so people know their tap worked.
Accessibility
An icon-only trigger needs an accessibility label.
Everything in the menu can be reached and used with the keyboard.
Focus returns to the trigger when the menu closes.
Don't use red as the only way to show that an action is destructive. The label should say what will happen.
Disabled items can't be activated.
