Redpanda UIRedpanda UI

Navigation Menu

A collection of links for navigating websites.

Made by shadcn

Installation

Loading component...

When to use

The Navigation Menu component provides structured navigation with dropdowns and nested content. Use this decision tree to determine when it's appropriate:

Usage

import {
  NavigationMenu,
  NavigationMenuContent,
  NavigationMenuIndicator,
  NavigationMenuItem,
  NavigationMenuLink,
  NavigationMenuList,
  NavigationMenuTrigger,
  NavigationMenuViewport,
} from "@/components/ui/navigation-menu"
<NavigationMenu>
  <NavigationMenuList>
    <NavigationMenuItem>
      <NavigationMenuTrigger>Item One</NavigationMenuTrigger>
      <NavigationMenuContent>
        <NavigationMenuLink>Link</NavigationMenuLink>
      </NavigationMenuContent>
    </NavigationMenuItem>
  </NavigationMenuList>
</NavigationMenu>

Examples

When using the Next.js <Link /> component, you can use navigationMenuTriggerStyle() to apply the correct styles to the trigger.

import { navigationMenuTriggerStyle } from "@/components/ui/navigation-menu"
<NavigationMenuItem>
  <Link href="/docs" legacyBehavior passHref>
    <NavigationMenuLink className={navigationMenuTriggerStyle()}>
      Documentation
    </NavigationMenuLink>
  </Link>
</NavigationMenuItem>

See also the Base UI documentation for handling client side routing.

Panel dropdowns

Loading component...

Multi-level nested

Loading component...

Inline submenus

Loading component...

Large scrollable panel

Loading component...
Loading component...

Rich content mega-menu

Loading component...
Loading component...

Vertical orientation

Loading component...

Props

Keyboard interactions

KeyAction
Tab into NavigationMenuListFocus lands on the first top-level trigger.
ArrowLeft / ArrowRightMoves between top-level triggers.
ArrowDown / Enter / SpaceOpens the focused trigger's content panel and moves focus inside.
Tab inside a content panelCycles focus through the panel's links.
EscapeCloses the open panel and restores focus to the trigger.

Accessibility

  • The menu container is role="menubar" (or navigation semantics when used as site nav). Use a real <nav> wrapper and give it an aria-label when there are multiple navigation regions on the page.
  • Links inside panels must be real <a> elements — wrap a framework-router link with asChild on NavigationMenuLink so keyboard activation and focus handling still work.
  • Base UI note: NavigationMenuIndicator is a no-op <div> — no auto-sized animated indicator is rendered. Use a custom element or additional CSS if you want this effect. See the migration callout.
  • Always provide a keyboard-accessible hamburger / skip-link on small screens; the navigation menu primitive is desktop-first.

Credits

  • We use Base UI for the navigation menu component.
  • We take our inspiration from Shadcn UI for the navigation menu style.

Recent changes

  • patchv1.2.0Pin shipped dependency floors to the version we develop against. Registry items now declare ranges like `^5.1.9` (the actual installed version) instead of collapsing to `^5.0.0`, so consumers start on the known-tested b…#133
  • minorv1.1.0Theme docs refresh, readability pass on semantic foregrounds, and consumer-facing Base UI regression fixes.#121
  • minorv1.0.0Post-Base-UI polish. Public API unchanged.#116
  • majorv1.0.0Migrate every Radix-based primitive to `@base-ui/react@^1.4.0` (Base UI).#114
  • patchv0.3.1**Accordion** - `AccordionTrigger` now shows `cursor-pointer` on hover.#112
See full history →
Built by malinskibeniamin. The source code is available on GitHub.

On this page