Skip to content

Navigation Menu Item

⋯

Navigation Menu Item renders the Figma Navigation Menu Item component: one item in a horizontal top navigation. It renders a native button, or a link when you pass render. It is a single part. The application owns the surrounding nav landmark, list, and routing.

import { NavigationMenuItem } from "@nesra/ui/navigation-menu-item";
import { House } from "lucide-react";
export function OverviewLink() {
return (
<NavigationMenuItem
active
render={<a aria-label="Overview" href="/overview" />}
startIcon={<House />}
>
Overview
</NavigationMenuItem>
);
}

NavigationMenuItem is also exported from @nesra/ui.

Overview
Figma property Code
Variant=Icon startIcon
Variant=Avatar avatar, with an Avatar at the default sm size
Show Icon Left Set or omit startIcon
Show Icon Right Set or omit endIcon
Show Avatar Set or omit avatar
Text Label children

When both avatar and startIcon are set, only avatar renders.

Figma State Code Label Outline
Default — Text/text-support none
Hover pointer hover Text/text-headline 1px Stroke/stroke-border
Active active Text/text-headline none until hovered

Icons use Icon/icon-neutral in every Figma state. Keyboard focus shows Box Shadow/Focus ring offset and the headline label. Figma does not define focus or disabled states. The code adds them: disabled sets Text/text-disabled and Icon/icon-disabled and blocks activation. Pass disabled to an Avatar in the avatar slot as well.

Wrap items in a nav landmark and a list. A Navigation Menu Item with a chevron can be the render element of DropdownMenu.Trigger. While its menu is open, the label keeps the headline color.

Navigation Menu Item follows the page theme. Dark applies when an ancestor has the dark class or data-theme="dark". The item has no fill in either mode. It uses the semantic roles listed under States.

  • Without render, the item is a native button. With render={<a href="…" />}, it is a link. The examples repeat the label as the anchor’s aria-label, as the Sidebar examples do, so linting can confirm the link has a name.
  • active sets aria-current="page". Pass aria-current to use another value, such as "true" for a section.
  • Icons and the avatar are hidden from assistive technology. children must name the item.
  • Put items inside a nav with an accessible name, such as aria-label="Main", and a ul. Mark only one item active per navigation.
  • Routing, link prefetching, and choosing the current item remain the application’s responsibility.
Prop Type Default Description
children ReactNode — Label. Required to name the item.
active boolean false Applies the Active state and sets aria-current="page".
startIcon ReactNode — 16px icon before the label. Hidden when avatar is set.
endIcon ReactNode — 16px icon after the label, such as a chevron for a menu trigger.
avatar ReactNode — 24px avatar before the label. Pass an Avatar at the default sm size.
render ReactElement — Element to render instead of a button, such as <a href="…" />.
aria-current ARIA value — Overrides the value set by active.
disabled boolean false Blocks activation and applies disabled colors.
className string — Adds or overrides classes.

Other Base UI Button props are forwarded. A ref points to the rendered element. The type is NavigationMenuItemProps.

The item is 36px tall with 16px horizontal padding, a 6px gap, an 8px radius, and Body/Small/Medium text. See Typography, Colors, and Avatar.