Homelogologo
Sponsor

Navigation Menu

A navigation menu that organizes and renders links and menus for seamless website navigation.

Anatomy

Explore the anatomy of the Navigation Menu component.

anatomy
<NavigationMenu> <NavigationMenu.List> <NavigationMenu.Item> <NavigationMenu.Trigger /> <NavigationMenu.ItemIndicator /> <NavigationMenu.Content> <NavigationMenu.Link /> </NavigationMenu.Content> </NavigationMenu.Item> <NavigationMenu.Indicator> <NavigationMenu.Arrow /> </NavigationMenu.Indicator> </NavigationMenu.List> <NavigationMenu.ViewportPositioner> <NavigationMenu.Viewport /> </NavigationMenu.ViewportPositioner> </NavigationMenu>

Examples

Basic

A basic example of the Navigation Menu component.

Vertical

To create a vertical sidebar navigation, set the orientation prop to vertical. This will position panels to the side, and the keyboard navigation behavior adapts accordingly:

  • ArrowUp and ArrowDown: Navigate between triggers.
  • ArrowRight: Open the selected panel.

This setup is ideal for creating collapsible or expandable sidebar menus.

API Reference

Provides the navigation menu with a list of items and a viewport for content.

PropertyTypeDefault
asChildbooleanundefined
closeDelaynumber300
defaultValuestringundefined
disableClickTriggerbooleanundefined
disableHoverTriggerbooleanundefined
disablePointerLeaveClosebooleanundefined
hideModeHideMode'display-none'
idstringundefined
idsPartial<{ root: string; list: string; item: string; trigger: (value: string) => string; content: (value: string) => string; viewport: string }>undefined
lazyMountbooleanfalse
onValueChange(details: ValueChangeDetails) => voidundefined
openDelaynumber200
orientation'horizontal' | 'vertical'"horizontal"
translationsIntlTranslationsundefined
unmountOnExitbooleanfalse
valuestringundefined

Used to trigger the navigation menu.

PropertyTypeDefault
asChildbooleanundefined

Used to render the content of the navigation menu.

PropertyTypeDefault
asChildbooleanundefined

Used to position the viewport of the navigation menu.

PropertyTypeDefault
asChildbooleanundefined

Used to render the viewport of the navigation menu.

PropertyTypeDefault
asChildbooleanundefined

Used to render an item in the navigation menu.

PropertyTypeDefault
asChildbooleanundefined
valuestringundefined

Used to render the list of items in the navigation menu.

PropertyTypeDefault
asChildbooleanundefined

Used to render a link in the navigation menu.

PropertyTypeDefault
asChildbooleanundefined

Used to render an indicator in the navigation menu.

PropertyTypeDefault
asChildbooleanundefined

Used to render an indicator in the navigation menu item.

PropertyTypeDefault
asChildbooleanundefined