Unified UI

Navigation Menu

A top-level navigation bar with animated dropdown panels, card-style links, and full keyboard navigation. Built on Radix UI.

Overview

NavigationMenu is a top-level site navigation component with animated dropdown panels. Built on Radix UI's NavigationMenu primitive, it supports card-style link items with icon, title, and description — ideal for marketing and docs site navbars.


Installation

Install the component via the CLI in one command.

npx @work-rjkashyap/unified-ui add navigation-menu
pnpm dlx @work-rjkashyap/unified-ui add navigation-menu
npx @work-rjkashyap/unified-ui add navigation-menu
bunx @work-rjkashyap/unified-ui add navigation-menu

If you haven't initialized your project yet, run npx @work-rjkashyap/unified-ui init first. See the CLI docs for details.

Or install the full package

Use this approach if you prefer to install the entire design system as a dependency instead of copying individual components.

npm install @work-rjkashyap/unified-ui
pnpm add @work-rjkashyap/unified-ui
yarn add @work-rjkashyap/unified-ui
bun add @work-rjkashyap/unified-ui

Anatomy

import {
	NavigationMenu,
	NavigationMenuList,
	NavigationMenuItem,
	NavigationMenuTrigger,
	NavigationMenuContent,
	NavigationMenuLink,
	NavigationMenuCardLink,
} from "@work-rjkashyap/unified-ui";

Examples

Basic with Dropdown


Props

PropTypeDefaultDescription
valuestringControlled open state for a specific item.
defaultValuestringDefault open item value.
onValueChange(value: string) => voidCallback when the open item changes.
dir"ltr" | "rtl"Reading direction.
orientation"horizontal" | "vertical""horizontal"Orientation of the menu.
classNamestringAdditional CSS classes.
PropTypeDefaultDescription
classNamestringAdditional CSS classes.
disabledbooleanfalseDisables the trigger.
PropTypeDefaultDescription
hrefstringThe URL the link points to.
activebooleanfalseMarks this link as the current active page.
asChildbooleanfalseRender as the child element.
classNamestringAdditional CSS classes.
PropTypeDefaultDescription
hrefstringRequired. The URL the card links to.
titlestringRequired. Title text for the card.
descriptionstringOptional description beneath the title.
iconReactNodeOptional icon rendered before the title.
activebooleanfalseMarks this link as currently active.
classNamestringAdditional CSS classes.

Accessibility

Use NavigationMenuLink with the active prop to mark the current page. This applies aria-current="page" automatically via Radix.

  • Tab — Moves focus between top-level triggers and links.
  • Enter / Space — Opens a trigger's dropdown content.
  • Arrow keys — Navigate between triggers and between items inside an open panel.
  • Escape — Closes the open panel and returns focus to the trigger.
  • Radix applies role="navigation", role="menubar", and aria-expanded automatically.

On this page