Français

<menu>

List commands or actions in a toolbar

  • HTML
  • accessibility
  • semantics

<menu> — The command menu

The <menu> element is a semantic alias for <ul> intended for toolbars and command menus. It represents a list of interactive actions, not a navigation list.

When to use it

You want to create a toolbar with action buttons: bold, italic, copy, paste. Or a context menu with commands. If your items are navigation links, use <nav> + <ul> instead.

What you gain

Accessibility: screen readers identify the group as a list of commands. Combine with role="toolbar" on a parent container and you get arrow-key navigation between actions.

Code example

<div role="toolbar" aria-label="Text formatting">
  <menu>
    <li><button type="button">Bold</button></li>
    <li><button type="button">Italic</button></li>
    <li><button type="button">Underline</button></li>
  </menu>
</div>

Further reading