On this page

Dropdown menu

Keys, what Dropdown menu gives you and what your team does.

Conformance

Dropdown menu meets WCAG 2.2 level AA when used as described on these pages. It follows the Menu Button pattern of the WAI-ARIA Authoring Practices.

Keyboard

Key Action
Down, Up Move between items. Disabled items are skipped.
Home, End Move to the first or last item.
Enter Runs the item and closes the menu. On a checkbox or radio item, ticks it.
Space Same as Enter.
Right On a sub-menu trigger, opens the sub-menu and moves into it.
Left In a sub-menu, closes it and goes back to its trigger.
Esc Closes the menu. Focus goes back to where it was.
A letter Moves to the next item that starts with it.

What Dropdown menu gives you

  • The trigger has aria-haspopup="menu" and aria-expanded; the menu is named by it.
  • role="menu" on the menu; menuitem, menuitemcheckbox with aria-checked, and menuitemradio on items; group on groups.
  • Arrow keys, typing a letter, sub-menus and Esc, as in the table above.
  • Disabled items stay in the reading order with aria-disabled, in the disabled text colour.

What your team does

  • Give an icon-only trigger a name (Icon button).
  • Use a DropdownMenuLabel for each group of checkbox or radio items, so the choice has a name.
  • Don’t hide the only way to do something in a sub-menu.

WCAG criteria

Criterion Level How
1.4.1 Use of Color A The checked state is a check mark, not a colour
2.1.1 Keyboard A Every item works with the keyboard
2.4.7 Focus Visible AA The highlighted item has color.surface.overlay.hover
4.1.2 Name, Role, Value A Menu roles, aria-checked, aria-expanded