Navigation Menu
The desktop site navigation on Base UI's Navigation Menu: caps bar items whose triggers open dropdown, overview or index panels under the bar. Inside a Navigation Bar it runs from --fgd-nav-inline-n-above (1024 px by default); below it the drawer takes over.
import {
NavigationMenu,
NavigationMenuItem,
NavigationMenuTrigger,
NavigationMenuContent,
NavigationMenuLink,
} from '@fairgarden/design/navigation/navigation-menu'
Triggers are buttons. They open on click, Enter, Space or ArrowDown, and on mouse hover intent: 150 ms (--fgd-delay-nav-open) to open and 300 ms (--fgd-delay-nav-close) to close after the pointer leaves, both fed to Base UI from the one NAV_DELAY_MS constant. Once a panel is open, the next trigger switches instantly, and the safe pointer path keeps a diagonal move into a panel from switching it. Focus alone never opens a panel. Opening from the keyboard moves focus to the panel's first link, and Escape closes it and returns focus to the trigger. Only the open trigger reads aria-expanded="true", and closed panels are unmounted.
Pass currentPath, or let the Navigation Bar pass it. A link whose path equals it is current (aria-current="page": the --border-size-2-25 bar and weight 700 in the bar, a weight and underline in a panel). A bar item whose section (for a trigger) or href is a path prefix of it is the parent of current (aria-current="true", a --border-size-2 bar). Hover is an accent underline under the label, and open is the --border-size-2-25 bar flush with the rule, so hover, open and current never look alike.
From the navigation data. NavigationMenuSections builds the items from the shared navigation data (SitemapSections from @fairgarden/design/utils/navigation), the same object that feeds the drawer's sections and the footer's sitemap, so the footer mirrors the panels (see the Footer's navigation demo). A section with a description, a promo or third-tier links opens an overview panel, panel: 'index' an index panel, and a flat section a dropdown that starts with its landing page; a section with only an href is a plain bar link.
Overview panels
Overview panels
kind="overview" is full-bleed under the bar, with its content on the 12-column grid of --fgd-container-content. featured takes the section's landing page, a serif link with a › and a one-line description, then a hairline tier rule. The children are caps link groups, 2-up in columns 1–8 beside the optional promo card (one Tab stop), or up to 4-up without it. search adds one Search field; the panel stays open while it has focus. A plain NavigationMenuContent is the dropdown list of 3–8 links. A panel taller than the viewport scrolls in a Scroll Area.
Index panels
Index panels
kind="index" is a nested vertical menu: NavigationMenuCategory rows (a --size-px-13 column at a 44 px pitch) beside the selected category's link pane, with a featuredBar across both. One category is always selected: the one holding the current page, else the first. It is marked by a --border-size-2-25 start-edge bar and weight 700. Categories switch on click, Enter or mouse rest. The panel attaches at its trigger's start edge, end-aligns inside the content container, and takes square top and --radius-2-25 bottom corners.
API Reference
NavigationMenu and NavigationMenuItem
The desktop site navigation [D182]: a nav labelled “Main” holding the
bar’s items. Triggers are buttons that open their panel on click, Enter,
Space or ArrowDown, and on hover intent under a mouse
(--fgd-delay-nav-open, closing --fgd-delay-nav-close after the pointer
leaves); focus alone never opens one. Opening from the keyboard moves
focus to the panel’s first link; Escape closes and returns focus to the
trigger. Panels attach at 0 offset under the bar’s bottom rule, switch
instantly and scroll in a Scroll Area when taller than the viewport.
| Prop | Type | Description |
|---|---|---|
label | | The landmark’s name. Default “Main”. |
currentPath | | The current page’s URL path. A link whose path equals it is current
( |
primary | | Primary Radix scale for the bar’s parts: labels, bars and focus ring.
Never defaulted; omitted, it inherits the scope [D133]. The panels keep
the |
secondary | | Secondary Radix scale for the bar’s parts: the chevrons and the hover
underline ( |
children | |
|
One bar item: a NavigationMenuTrigger with its NavigationMenuContent,
or a plain NavigationMenuLink. value identifies it when the menu is
controlled; omitted, one is generated.
NavigationMenuTrigger and NavigationMenuLink
A bar trigger: a button with a caps label (type-label, [D165]) and the
expand_more chevron in --role-glyph, which flips while open. It opens
its panel on click, Enter, Space, ArrowDown or mouse hover intent, never
on focus alone; the section’s landing page is the panel’s first link.
| Prop | Type | Description |
|---|---|---|
section | | The path of the section this trigger opens ( |
A link. In the bar it is a caps item with no rest underline; in a panel
it is a type-body-ui row at a --fgd-size-hit pitch in Link’s list-link
build (kind="nav" with list), whose hover is --role-link-hover only
(§9.3) [D181]. active defaults to “its path is the current page”
(aria-current="page"); a bar link whose path is a prefix of the page is
the parent of current. Panel links close the panel on click.
NavigationMenuContent
A panel. It renders in the menu’s portaled white overlay scope,
attached under the bar’s bottom rule: overview full-bleed with its
content on the 12-column grid of --fgd-container-content; index and
dropdown at the trigger’s start edge, end-aligned to the content
container, with square top and --radius-2-25 bottom corners.
| Prop | Type | Description |
|---|---|---|
featured | | |
featuredBar | | |
kind | |
|
promo | | |
search | | |
children | |
Overview parts: NavigationMenuFeatured, NavigationMenuGroup and NavigationMenuPromo
The overview link (featured): the trigger’s own section landing page, a
type-itemhead serif link in --role-heading with a trailing › in
--role-accent, then its description. Put it in featured.
| Prop | Type | Description |
|---|---|---|
description | | One line of |
A caps link group in an overview panel: a heading (a link with › when
href is given) over its links at a --fgd-size-hit pitch.
| Prop | Type | Description |
|---|---|---|
heading | | The group heading, set in |
href | | Makes the heading a link with a trailing ›, to the group’s landing page. |
children | | The group’s |
The optional promo card of an overview panel (≤ 1 per panel): a §12.2
card with a 16:9 image, a stretched title link (one Tab stop) and a
blurb. Its hover is the title link’s --role-link-hover; no shadow.
| Prop | Type | Description |
|---|---|---|
href | | The destination: the card’s one Tab stop, its stretched title link. |
image | | A 16:9 image (an |
title | | The title, |
children | | A two-line |
className | | Class names for the card, added after its own. |
Index parts: NavigationMenuCategory and NavigationMenuFeaturedBar
One category of an index panel: a row in the category list (a trigger
of the nested vertical menu) and its links in the pane. The selected
category takes a --border-size-2-25 start-edge bar and --font-weight-7.
| Prop | Type | Description |
|---|---|---|
label | | The category row’s label. |
value | | Identifies the category; omitted, the panel assigns one. |
children | | The category’s |
className | | Class names for the category row, added after its own. |
The featured bar of an index panel: one type-itemhead link with a ›
in --role-glyph, across both panes above a --role-hairline rule. Put
it in featuredBar.
Additional types
NAV_DELAY_MS
navigationMenu
NavigationMenuCategoryProps
navigationMenuContent
NavigationMenuContentKind
NavigationMenuContentProps
NavigationMenuFeaturedBarProps
NavigationMenuFeaturedProps
NavigationMenuFrame
NavigationMenuFrameContext
NavigationMenuGroupProps
NavigationMenuItemProps
NavigationMenuLinkProps
NavigationMenuPromoProps
NavigationMenuProps
NavigationMenuSectionsProps
NavigationMenuTriggerProps
Specification: DESIGN-SYSTEM.md §9.6 (navigation menu) [D181, D182], with the overlay panels of §9.1 and the fit budget of §11.5 [D183].