Navigation Menu

Navigation Menu

Navigation
Overlay

Complex navigation menu with dropdown support and hover interactions for application headers.

Preview

Hover over menu items to see dropdown content

Simple Links

Navigation with simple links only

Props

Component API reference

NavigationMenu

PropTypeDefaultDescription
children*ReactNode—Menu content
classNamestring—Additional CSS classes
delayDurationnumber200Hover delay in ms before a dropdown opens
value / defaultValue / onValueChangestring—Control which dropdown is open (Radix NavigationMenu props)

NavigationMenuTrigger

PropTypeDefaultDescription
children*ReactNode—Trigger content
idstring—Optional and unused. Trigger and content are paired by their NavigationMenuItem

NavigationMenuLink

PropTypeDefaultDescription
href*string—Link URL
iconLucideIcon—Icon component
descriptionstring—Link description
featuredbooleanfalseHighlight as featured

NavigationMenuDropdown

PropTypeDefaultDescription
widthnumber500Dropdown width in pixels
children*ReactNode—Dropdown content

Usage

Import and implementation examples

import {
NavigationMenu,
NavigationMenuList,
NavigationMenuItem,
NavigationMenuTrigger,
NavigationMenuContent,
NavigationMenuLink,
NavigationMenuDropdown,
NavigationMenuSimpleLink,
} from '@/components/ui/navigation-menu'
import { Layers, Zap } from 'lucide-react'
// With dropdown menus
<NavigationMenu>
<NavigationMenuList>
<NavigationMenuItem>
<NavigationMenuTrigger>
Products
</NavigationMenuTrigger>
<NavigationMenuContent>
<NavigationMenuDropdown width={600}>
<div className="grid grid-cols-2 gap-3">
<NavigationMenuLink
href="/design-system"
icon={Layers}
description="Build beautiful interfaces"
featured
>
Design System
</NavigationMenuLink>
<NavigationMenuLink
href="/components"
icon={Zap}
description="Lightning-fast development"
>
Components
</NavigationMenuLink>
</div>
</NavigationMenuDropdown>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuSimpleLink href="/pricing">
Pricing
</NavigationMenuSimpleLink>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>

Features

Built-in functionality

  • Hover interactions: Dropdowns open on hover
  • Featured items: Highlight important links
  • Icon support: Add icons to menu links
  • Descriptions: Add context to each link
  • Custom widths: Configurable dropdown widths
  • Simple links: Direct navigation without dropdowns
  • Grid layouts: Flexible dropdown content layouts

Accessibility

Accessibility considerations

ARIA Attributes

Built on Radix NavigationMenu: a nav landmark labelled "Main" (override with aria-label)Triggers carry aria-expanded and aria-controls pointing at their dropdownDropdown content is labelled by its trigger (aria-labelledby)Links are plain anchors, so they keep link semantics

Keyboard Navigation

KeyAction
TabMove between triggers and links, and into an open dropdown
Arrow Left / RightMove between top-level items
Enter / SpaceOpen or close the focused dropdown
Arrow DownMove from an open trigger into its dropdown
Arrow keys, Home / EndMove between links inside the dropdown
EscapeClose the dropdown and return focus to its trigger

Notes

  • Hover opens after a short delay (delayDuration) and closes when the pointer leaves
  • Clicking outside or moving focus out closes the dropdown
  • Choosing a link closes the dropdown