shadcn.io is not affiliated with official shadcn/ui
Navigation Menu examples · Standard
Simple Navigation Navigation Menu for React
A navigation menu with Products and Solutions dropdowns and a Pricing link.
The smallest site header menu: Products and Solutions open a short list of links each, and Pricing goes straight to its page. Start here and grow the panels as your site does.
Preview
Installation
FAQ
Which parts make up the menu?
NavigationMenu and NavigationMenuList hold one NavigationMenuItem per entry. A dropdown is a NavigationMenuTrigger with a NavigationMenuContent of NavigationMenuLinks; Pricing is a NavigationMenuLink on its own.
Why does Pricing look like the triggers?
It takes navigationMenuTriggerStyle() as its class, so a plain link lines up with the dropdown triggers beside it.
Where do the links come from?
Two sections at the top of the file, each a trigger label and its links, mapped to one item each. Edit that list to change the menu.
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="#" />}.
Related
- Mixed Links and Dropdowns Navigation MenuA navigation menu that mixes Products and
- Navigation without Viewport Navigation MenuProducts and Company dropdowns that each
- Navigation with Icons Navigation MenuA Features dropdown whose links each
- Navigation with Descriptions Navigation MenuA Resources dropdown whose links pair an
- Dashboard-style with Stats Navigation MenuAn Analytics dropdown with four stat
- Full Mega Menu Navigation MenuA wide Platform mega menu with feature