Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Navigation Menu examples · Standard

Navigation without Viewport Navigation Menu for React

Products and Company dropdowns that each open their own panel under their trigger.

Framework
UI library

Products and Company each open a list of four links in a panel under their own trigger, instead of one shared panel under the whole menu. That keeps small dropdowns next to the word that opened them.

Preview

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

FAQ

How does each panel open under its own trigger?

Base UI always opens panels in one popup, which moves to the trigger that is open, so the demo passes no prop.

How wide is each panel?

w-48 on the column inside NavigationMenuContent.

How do the links use my router?

Each link is your router's link rendered through NavigationMenuLink, so it keeps the menu's styles and focus handling. NavigationMenuLink takes the Next.js Link through render, as in render={<Link href="#" />}.

How does the menu work from the keyboard?

Tab moves between the triggers and the links, Enter or Space opens a trigger's panel, and Escape closes it and returns focus to the trigger. The root is a nav, so screen readers list it as a navigation landmark.

How do I mark the current page?

Set aria-current="page" on the NavigationMenuLink that matches the route, and style it with the aria-[current=page]: variant. active on NavigationMenuLink sets it for you.