NavigationMenu
A collection of links for navigating websites, with hover-activated dropdown panels
Examples
Default
With Active State
With Indicator
API
The element family below can be composed together. Click an element to jump to its properties.
| Element | Purpose |
|---|---|
| NavigationMenu | Root <nav> container. Renders a shared hover-activated viewport for all item dropdowns. Set Viewport="false" to suppress the viewport (plain nav bar only). |
| NavigationMenuList | Horizontal <ul> holding the top-level NavigationMenuItems and an optional NavigationMenuIndicator. Place inside a NavigationMenu. |
| NavigationMenuItem | One item in the menu bar. Supplies a Trigger slot for the visible button and an optional Content slot whose content is shown in the shared viewport on hover. |
| NavigationMenuTrigger | Styled <button> for a NavigationMenuItem's Trigger slot. Renders a chevron that rotates when the shared viewport is open for this item. |
| NavigationMenuContent | Inner wrapper for the dropdown body. Place inside a NavigationMenuItem's Content slot. |
| NavigationMenuLink | Styled <a> for use inside NavigationMenuContent or as a plain menu-bar entry in a NavigationMenuItem's Trigger slot. |
| NavigationMenuIndicator | Optional diamond-shaped arrow caret that tracks the active trigger, rendered inside NavigationMenuList. Positioned automatically via the parent NavigationMenu's state. |
| NavigationMenuViewport | Represents the shared popup viewport. Rendered internally by NavigationMenu — consumers do not need to add this component manually. |
NavigationMenu
Root <nav> container. Renders a shared hover-activated viewport for all item dropdowns. Set Viewport="false" to suppress the viewport (plain nav bar only).
| Property | Type | Required | Description |
|---|---|---|---|
| Viewport | bool | When true (default), a shared viewport panel is rendered below the menu bar. Set to false for a plain nav bar with no dropdowns. | |
| ClassName | string? | Extra CSS classes appended to the <nav>. | |
| ChildContent | RenderFragment? | Should contain a NavigationMenuList and optionally a NavigationMenuIndicator inside the list. | |
| AdditionalAttributes | Dictionary<string, object>? | Captured unmatched attributes, forwarded to the <nav>. |
NavigationMenuList
Horizontal <ul> holding the top-level NavigationMenuItems and an optional NavigationMenuIndicator. Place inside a NavigationMenu.
| Property | Type | Required | Description |
|---|---|---|---|
| ClassName | string? | Extra CSS classes appended to the <ul>. | |
| ChildContent | RenderFragment? | One or more NavigationMenuItem children, plus an optional NavigationMenuIndicator. |
NavigationMenuItem
One item in the menu bar. Supplies a Trigger slot for the visible button and an optional Content slot whose content is shown in the shared viewport on hover.
| Property | Type | Required | Description |
|---|---|---|---|
| Trigger | RenderFragment? | The visible menu entry — typically a NavigationMenuTrigger (opens dropdown) or a NavigationMenuLink (plain link). | |
| Content | RenderFragment? | Optional dropdown body, usually a NavigationMenuContent. Omit for non-dropdown items. | |
| ClassName | string? | Extra CSS classes appended to the item <li>. |
NavigationMenuTrigger
Styled <button> for a NavigationMenuItem's Trigger slot. Renders a chevron that rotates when the shared viewport is open for this item.
| Property | Type | Required | Description |
|---|---|---|---|
| Active | bool | When true, applies primary bg/fg styling. Default: false. | |
| ClassName | string? | Extra CSS classes appended to the <button>. | |
| ChildContent | RenderFragment? | Trigger label. | |
| AdditionalAttributes | Dictionary<string, object>? | Captured unmatched attributes, forwarded to the <button>. |
NavigationMenuContent
Inner wrapper for the dropdown body. Place inside a NavigationMenuItem's Content slot.
| Property | Type | Required | Description |
|---|---|---|---|
| ClassName | string? | Extra CSS classes — commonly w-[400px] to size the dropdown panel. | |
| ChildContent | RenderFragment? | Links or custom markup shown in the dropdown. |
NavigationMenuLink
Styled <a> for use inside NavigationMenuContent or as a plain menu-bar entry in a NavigationMenuItem's Trigger slot.
| Property | Type | Required | Description |
|---|---|---|---|
| Href | string? | URL to navigate to. | |
| Active | bool | When true, applies accent background styling. Default: false. | |
| ClassName | string? | Extra CSS classes appended to the <a>. | |
| ChildContent | RenderFragment? | Link content — title, description, icons. | |
| AdditionalAttributes | Dictionary<string, object>? | Captured unmatched attributes, forwarded to the <a>. |
NavigationMenuIndicator
Optional diamond-shaped arrow caret that tracks the active trigger, rendered inside NavigationMenuList. Positioned automatically via the parent NavigationMenu's state.
This element has no public parameters.
NavigationMenuViewport
Represents the shared popup viewport. Rendered internally by NavigationMenu — consumers do not need to add this component manually.
This element has no public parameters.