Skip to main content
A menu designed for website navigation, with support for nested menus and hover interactions. Navigation menus are ideal for site navigation bars and complex navigation patterns.

Import

Basic Usage

Key Components

Groups all parts of the navigation menu. Renders a <nav> element at the root, or <div> element when nested. Key Props:
  • value: any - The controlled value of the navigation menu item that should be currently open
  • defaultValue: any - The uncontrolled value of the item that should be initially selected (default: null)
  • onValueChange: (value: any, eventDetails: ChangeEventDetails) => void - Callback fired when the value changes
  • orientation: 'horizontal' | 'vertical' - The orientation of the navigation menu (default: 'horizontal')
  • delay: number - How long to wait before opening the navigation menu, in milliseconds (default: 50)
  • closeDelay: number - How long to wait before closing the navigation menu, in milliseconds (default: 50)
  • onOpenChangeComplete: (open: boolean) => void - Event handler called after any animations complete when the navigation menu is closed
State:
  • data-open: Present when the popup is open
  • data-nested: Present when the navigation menu is nested
Contains the navigation menu items. Renders a <div> element. Wraps a trigger and content pair. Renders a <div> element. Key Props:
  • value: any - The unique value for this navigation item (required)
A button that opens the navigation menu content. Renders a <button> element. State:
  • data-open: Present when the associated content is open
  • data-disabled: Present when the trigger is disabled
A container for the navigation content. Renders a <div> element. State:
  • data-open: Present when the popup is open
  • data-side: The side of the anchor element where the popup is positioned
  • data-align: The alignment of the popup relative to the anchor
The content area of the navigation menu. Renders a <div> element. A link item within the navigation menu. Renders an <a> element. Key Props:
  • href: string - The URL the link points to
  • active: boolean - Whether the link represents the current page
State:
  • data-active: Present when the link is active
An optional viewport for animating content transitions. Renders a <div> element.

Features

  • Hover-based navigation with configurable delays
  • Keyboard navigation support
  • Nested menu support
  • Active link indication
  • Flexible positioning with NavigationMenu.Positioner
  • Optional backdrop with NavigationMenu.Backdrop
  • Portal rendering with NavigationMenu.Portal
  • Smooth transitions with NavigationMenu.Viewport
  • Accessible ARIA attributes

Styling Example

Common Patterns

Controlled Navigation Menu

With Viewport Transitions

Rich Content Navigation

Vertical Navigation