Navigation Menu
Website-style mega-menu with hover-triggered content panels. Used for marketing/site navigation headers.
Installation
pnpm dlx @hex-core/cli add navigation-menuWith viewport indicator
NavigationMenuIndicator renders the small underline arrow that follows the active trigger; the viewport is rendered automatically by <NavigationMenu>.
<NavigationMenu>
<NavigationMenuList>
<NavigationMenuItem>
<NavigationMenuTrigger>Learn</NavigationMenuTrigger>
<NavigationMenuContent>
<ul className="grid w-[280px] gap-2 p-3">
<li><NavigationMenuLink href="/docs">Documentation</NavigationMenuLink></li>
<li><NavigationMenuLink href="/guides">Guides</NavigationMenuLink></li>
<li><NavigationMenuLink href="/changelog">Changelog</NavigationMenuLink></li>
</ul>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuTrigger>Company</NavigationMenuTrigger>
<NavigationMenuContent>
<ul className="grid w-[280px] gap-2 p-3">
<li><NavigationMenuLink href="/about">About</NavigationMenuLink></li>
<li><NavigationMenuLink href="/careers">Careers</NavigationMenuLink></li>
</ul>
</NavigationMenuContent>
</NavigationMenuItem>
</NavigationMenuList>
<NavigationMenuIndicator />
</NavigationMenu>API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | Controlled active menu value |
onValueChange | function | — | Callback when active menu changes |
delayDuration | number | 200 | Delay before opening a menu on hover (ms) |
orientation | "horizontal" | "vertical" | horizontal | Layout direction |
AI Guidance
When to use
Use for marketing-site top nav with grouped links and mega-menus: Products, Resources, Pricing flyouts. Desktop-first but keyboard accessible.
When not to use
Don't use for app shell menus (use Menubar). Don't use for single dropdowns (use DropdownMenu). On mobile, pair with a separate hamburger/Drawer pattern — NavigationMenu collapses poorly on small screens.
Common mistakes
- Mixing regular <a> with NavigationMenuLink — must use NavigationMenuLink for keyboard/roving focus
- Forgetting the viewport — handled automatically when using the composed NavigationMenu root
- Too many top-level items overflow on mobile
Accessibility
Radix implements the WAI-ARIA menu-button pattern with hover-intent delays and focus trapping in content. Links inside NavigationMenuLink get roving tabindex.
Related components
Token budget: 800
Verified against @hex-core/components@1.12.0