Skip to content

NavigationMenu

A horizontal site-level navigation bar with rich popover panels for nested sections, built on Radix Navigation Menu.

  • stable
  • since v0.1.0
  • 5.0 kB
  • navigation
  • menu
  • accessible

Renders inside a nav landmark; triggers expose aria-expanded / aria-controls; arrow keys traverse top-level items; Esc closes any open panel.

Preview
Open
tsx

Each NavigationMenuContent renders inside an elevated Card — fill it with any layout you like (grids, columns, banners).

Preview
Open
tsx

Pass hideChevron to NavigationMenuTrigger when the label is self-explanatory or you want to provide your own affordance.

Preview
Open
tsx

Mark a NavigationMenuLink with active to set aria-current="page" plus a data-active flag.

Preview
Open
tsx

Render NavigationMenuIndicator inside the list to show a small arrow pointing from the open trigger to its panel. Use this with NavigationMenuViewport for the shared-panel animation pattern.

Preview
Open
tsx
PropTypeDefaultDescription
value
string
defaultValue
string
onValueChange
((value: string) => void)
orientation
"horizontal"|"vertical"
Reserved for API parity.
dir
"ltr"|"rtl"
delayDuration
number
skipDelayDuration
number
  • The root renders inside a <nav> so screen readers identify it as primary navigation.
  • Triggers expose aria-expanded / aria-controls linking to their NavigationMenuContent panel (handled by Radix).
  • Left and right arrow keys move between top-level triggers; pressing Enter, Space, or opens the focused trigger’s panel.
  • Esc closes any open panel and returns focus to its trigger.
  • NavigationMenuLink with active sets aria-current="page" so the current route is announced.
  • Use NavigationMenuViewport once at the end of the list when you want a single shared panel that animates between triggers.
  • Use NavigationMenuSub for nested sub-panels (rare, but exposed for parity with Radix).
  • Swap to a Drawer or Sidebar below the tablet breakpoint where horizontal space runs out.
  • Wrap NavigationMenuLink with asChild to compose with a router-aware <Link>.