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

Keyboard

KeysWhat happens
EnterSpace↓On its trigger: opens it, on the first item.
↑↓Moves between items.
→←Opens and closes a submenu; mirrored in right to left.
A–ZJumps to the item that starts with the letter.
EnterChooses the item.
EscapeCloses it; focus returns to the trigger.

02

Behaviour

Roles
role="menu" of menuitem, menuitemcheckbox and menuitemradio.
Tab
It never traps Tab: Tab closes it and moves on.
Highlight
The 2px Ember start bar, following the text direction; Highlight in forced colours.
Descriptions
A description describes its item; the label alone names it.

03

Tested

On every change, before it ships.

  • axe, WCAG 2.2 A and AA, in Chromium on every pull request
  • Firefox and WebKit every night
  • Focus: where it lands as it opens, and where it returns as it closes
  • Forced colours, reduced motion and right to left
Next — MenuChangelog