Compose the list, the triggers, and the panels.
site-nav.tsx
NavigationMenu
<nav>| Prop | Type | Default | Description | |||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | ||||||||||||||||||||||||||||||||||||||
| popup | boolean | true | Render the popup after the children (default true, as in shadcn). Set false to place a NavigationMenuPositioner yourself, or for an inline nested submenu that shows its content in a NavigationMenuViewport. | |||||||||||||||||||||||||||||||||||||
| popup | NavigationMenuPositionerProps | — | The props of the popup it renders: the positioner props, arrow, backdrop, and the parts. | |||||||||||||||||||||||||||||||||||||
From Base UINavigationMenu.RootBase UI docs | ||||||||||||||||||||||||||||||||||||||||
| actions | — | A ref to imperative actions. - unmount: Ends the closing phase of the navigation menu popup after an externally controlled closing animation finishes. Call preventUnmountOnClose in onValueChange first, otherwise the navigation menu popup completes closing on its own. Whether it leaves the DOM is decided by keepMounted on the portal. - close: Closes the navigation menu imperatively when called. | ||||||||||||||||||||||||||||||||||||||
| on | — | Event handler called after any animations complete when the navigation menu is closed. | ||||||||||||||||||||||||||||||||||||||
| value | Value | null | null | The controlled value of the navigation menu item that should be currently open. When non-nullish, the menu will be open. When nullish, the menu will be closed. To render an uncontrolled navigation menu, use the defaultValue prop instead. | |||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||
| ...props | <nav> attributes | — | Every other attribute goes to the <nav>, with a ref. | |||||||||||||||||||||||||||||||||||||
NavigationMenuList
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
NavigationMenuItem
<li>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
From Base UINavigationMenu.ItemBase UI docs | |||
| value | any | — | A unique value that identifies this navigation menu item. If no value is provided, a unique ID will be generated automatically. Use when controlling the navigation menu programmatically. |
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |
| ...props | <li> attributes | — | Every other attribute goes to the <li>, with a ref. |
NavigationMenuIndicator
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
NavigationMenuTrigger
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| class | string | — | |||||
| indicator | NavigationMenuIndicatorProps | — | The props of its NavigationMenuIndicator (the chevron). | ||||
From Base UINavigationMenu.TriggerBase UI docs | |||||||
| disabled | boolean | false | Whether the component should ignore user interaction. | ||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
NavigationMenuContent
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
From Base UINavigationMenu.ContentBase UI docs | |||
| keep | boolean | false | Whether to keep the content mounted in the DOM while the popup is closed. Ensures the content is present during server-side rendering for web crawlers. |
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
NavigationMenuLink
<a>| Prop | Type | Default | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| variant | "card""top" | "card" | ||||||||
| class | string | — | ||||||||
From Base UINavigationMenu.LinkBase UI docs | ||||||||||
| active | boolean | false | Whether the link is the currently active page. | |||||||
| close | boolean | false | Whether to close the navigation menu when the link is clicked. | |||||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | ||||||||
| ||||||||||
| ...props | <a> attributes | — | Every other attribute goes to the <a>, with a ref. | |||||||
NavigationMenuPositioner
<div>| Prop | Type | Default | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| arrow | boolean | false | Show an arrow that points at the trigger. The gap grows from 4px to 8px. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| backdrop | boolean | false | Put a clear layer under the popup (Base UI NavigationMenu.Backdrop), for example to dim it. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| portal | — | Other Base UI props of the inner parts. A className here adds to the component classes. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| positioner | — | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| backdrop | — | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| arrow | PopupPartProps<NavigationMenuArrowProps> | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| viewport | — | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From Base UINavigationMenu.PortalBase UI docs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| anchor | — | An element to position the popup against. By default, the popup will be positioned against the trigger. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| position | "absolute""fixed" | 'absolute' | Determines which CSS position property to use. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| side | "bottom""inline-end""inline-start""left""right""top" | 'bottom' | Which side of the anchor element to align the popup against. May automatically change to avoid collisions. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
NavigationMenuViewport
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
| Tab | Moves through the triggers, the top links, and the open panel. |
|---|---|
| ← → | Moves along the list. |
| EnterorSpaceor↓ | Opens a panel. In a vertical menu, use → in place of ↓. |
| Esc | Closes the panel. |
Built with
Installs with Navigation Menu
- Components
- Button,Collapsible



