Skip to Content
Navigation & Menus@hacline/ui/navigation-menu

NavigationMenu

Expand grouped site links from a row of navigation triggers.

Usage

Click "Get started" or "Examples" to expand the corresponding links. Placing NavigationMenuViewport next to the list lets menus share a floating container.

Opening Independent Panels on Click

Disable hover-to-open so each panel can be positioned independently. Entries without submenus act directly as navigation links.

Parts

PartDescription
NavigationMenuContent
Renders into the viewport while its item is open, as its own popup without a viewport, and in place while closed and kept.
NavigationMenuIndicator
Sits under the open trigger, or under the link with current while every panel is closed. Screen readers skip it.
NavigationMenuItem
One item: a link, or a trigger and the content it opens.
NavigationMenuLink
A link. Pressing it closes the menu, and current marks the current page with aria-current="page".
NavigationMenuLinkIcon
An icon inside a link. Screen readers skip it, and mirror flips it in right-to-left text.
NavigationMenuList
The list of top-level items.
NavigationMenuTrigger
The button that opens its item's content. Resting the pointer on it opens the content too.
NavigationMenuViewport
The one popup every content renders into. It takes the open content's size as --viewport-width and --viewport-height, and moves to the open trigger.

Props

Prop

Type

View parts and state attributes in UI SDK.