Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Navigation Menu examples · Complex

Full Mega Menu Navigation Menu for React

A wide Platform mega menu with feature, resource and company columns beside a tutorial and a contact panel.

Framework
UI library

Platform opens a full-width mega menu: core and advanced features with descriptions, resource and company links, and a sidebar with a tutorial card and a contact panel. Use it when the site has many sections and the header is the main way in.

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 are the columns laid out?

A three-column grid, grid-cols-[2fr_1fr_1fr]: the feature groups take the widest column, the resource and company links the middle, and the two panels the last.

How are the groups built?

From lists at the top of the file: two feature groups with descriptions and two link groups, each with a title. Resource links have icons; company links don't.

What happens on narrow screens?

The panel is w-[900px] with max-w-full, so it never grows past the screen, but its columns get tight. Below the md breakpoint, show the same links in a Sheet or a Drawer instead.

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.