Skip to main content
  1. Docs
  2. Components
  3. Overlays

Menu

Actions in a list, from a button: arrows move, typing jumps, Escape closes. It never traps Tab.

Import
@qeetrix/react
Status
StableSince 0.0.2
Renders
<div role="menu">Server-rendered
Tested
WCAG 2.2 AAaxe on every pull request

01

When to use

Use it for
  • A row's or a card's actions, behind ⋯.
  • Options that turn on or off, or choose one, for a view.
  • More actions than fit as buttons.
Not for
  • Choosing a value in a formSelect
  • Moving between pagesTabs
  • The main action of a regionButton

02

Anatomy

  1. 1menu-item<div role="menuitem">An action; highlighted, the 2px Ember bar at its start.
  2. 2menu-item-icon<svg>A leading icon, sharp, 16px.
  3. 3menu-shortcut<span>Its key, hidden from screen readers.
  4. 4menu-separator<div role="separator">A 1px rule between groups, edge to edge.
  5. 5menu-item<div role="menuitem">The destructive action: danger, last, after a rule.

03

Do and don't

Destructive last
DoAfter a rule, at the end: hard to hit by accident.
Don'tFirst in the list, where the pointer lands.
Verbs, not nouns
DoEach item says what it does.
Don'tNouns: what happens to the profile?

04

Content

  • Items are verbs, in sentence case: "Remove from Acme".
  • Name the trigger for its object: "Actions for Priya Sharma".
  • Shortcuts as people type them: "Ctrl+D".
Next — MenuAPI