How to build an accessible NavigationMenu in React

Wrapped in a navigation landmark with a roving-tabindex row of links and disclosure triggers; triggers expose aria-expanded/aria-controls onto a flyout panel, and outside-pointer or Escape dismisses the open panel and restores trigger focus

When to use a NavigationMenu

When not to use it

Keyboard interactions

Role navigation, verified at WCAG 2.2-AA.

Common mistakes

Avoid: Putting action commands (Save, Delete) inside NavigationMenu flyouts

Prefer: <Menubar> or <Menu> for commands; NavigationMenu is for destinations

navigation landmark implies moving between destinations, not invoking actions

Example

<NavigationMenu aria-label="Main" items={[{ id: "home", label: "Home", href: "/" }, { id: "products", label: "Products", content: <ul>…</ul> }]} />

See the full NavigationMenu reference →