Skip to main content

Navigation Menu

A collection of links for navigating websites.

import {
NavigationMenu,
NavigationMenuList,
NavigationMenuItem,
NavigationMenuLink,
} from "@/components/ui/navigation-menu"

<NavigationMenu>
<NavigationMenuList>
<NavigationMenuItem>
<NavigationMenuLink href="#">Home</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink href="#">About</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink href="#">Contact</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink href="#">Support</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink href="#">Wallet</NavigationMenuLink>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>

API Reference

The root component that wraps the navigation menu.

PropTypeDefaultDescription
defaultValuestringDefault active value for uncontrolled usage
valuestringControlled active value
onValueChange(value: string) => voidCallback when active value changes
delayDurationnumber200Duration from when the mouse enters a trigger until the content opens
skipDelayDurationnumber300How much time a user has to enter another trigger without incurring a delay again
orientation"horizontal" | "vertical""horizontal"The orientation of the menu

Contains the top-level menu items. Renders as an unordered list.

A top-level menu item. Can contain a trigger and content for submenus, or a direct link.

PropTypeDefaultDescription
valuestringUnique value for controlled state

The button that opens a submenu. Renders with a caret indicator.

The content area that appears when a trigger is activated. Supports animated enter/exit transitions.

PropTypeDefaultDescription
forceMountbooleanForce mount the content for animation control

A navigational link. Use asChild to compose with framework-specific link components.

PropTypeDefaultDescription
asChildbooleanfalseMerge props onto child element
activebooleanWhether the link is currently active
onSelect(event: Event) => voidCallback when the link is selected

The viewport that contains the submenu content. Automatically rendered by the root component.

An optional indicator element that highlights the active trigger.

Accessibility

The Navigation Menu component follows WAI-ARIA navigation patterns:

  • Uses semantic <nav> element for landmark navigation
  • List structure conveys grouping to screen readers
  • Keyboard navigation with Arrow keys moves between items
  • Enter and Space activate links and triggers
  • Escape closes any open submenus
  • Supports aria-current for indicating the active page
  • Focus management follows the roving tabindex pattern