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-menupnpm dlx @work-rjkashyap/unified-ui add navigation-menunpx @work-rjkashyap/unified-ui add navigation-menubunx @work-rjkashyap/unified-ui add navigation-menuIf 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-uipnpm add @work-rjkashyap/unified-uiyarn add @work-rjkashyap/unified-uibun add @work-rjkashyap/unified-uiAnatomy
import {
NavigationMenu,
NavigationMenuList,
NavigationMenuItem,
NavigationMenuTrigger,
NavigationMenuContent,
NavigationMenuLink,
NavigationMenuCardLink,
} from "@work-rjkashyap/unified-ui";Examples
Basic with Dropdown
Plain Links Only
Featured + Grid Layout
Props
NavigationMenu
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | Controlled open state for a specific item. |
defaultValue | string | — | Default open item value. |
onValueChange | (value: string) => void | — | Callback when the open item changes. |
dir | "ltr" | "rtl" | — | Reading direction. |
orientation | "horizontal" | "vertical" | "horizontal" | Orientation of the menu. |
className | string | — | Additional CSS classes. |
NavigationMenuTrigger
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Additional CSS classes. |
disabled | boolean | false | Disables the trigger. |
NavigationMenuLink
| Prop | Type | Default | Description |
|---|---|---|---|
href | string | — | The URL the link points to. |
active | boolean | false | Marks this link as the current active page. |
asChild | boolean | false | Render as the child element. |
className | string | — | Additional CSS classes. |
NavigationMenuCardLink
| Prop | Type | Default | Description |
|---|---|---|---|
href | string | — | Required. The URL the card links to. |
title | string | — | Required. Title text for the card. |
description | string | — | Optional description beneath the title. |
icon | ReactNode | — | Optional icon rendered before the title. |
active | boolean | false | Marks this link as currently active. |
className | string | — | Additional 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", andaria-expandedautomatically.