Skip to content

shadcn.io is an independent project built on shadcn/ui

Resources with Lead Magnets Navigation Menu for React

A Resources dropdown with Documentation, Video Tutorials, and Blog, plus a featured guide and a webinar signup.

The bar shows Resources. The panel lists Documentation, Video Tutorials, and Blog, a Featured guide called Complete Platform Guide with Download Free, and a webinar with Register Now.

Use the panel when a download or a signup should ride along with the links. A Dialog fits better for a form that must be finished. In React, Base UI moves between the triggers with Tab.

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.
Use email insteadNo credit card

Anatomy

Navigation Menu anatomy: list, trigger, indicator, content, link

Usage

<div className="w-full max-w-md rounded-md border bg-background p-px">
  <NavigationMenu>
    <NavigationMenuList>
      <NavigationMenuItem>
        <NavigationMenuTrigger>Resources</NavigationMenuTrigger>
        <NavigationMenuContent>
          <div className="flex w-[600px] max-w-full flex-col gap-4 p-2">
            <div className="grid grid-cols-[1fr_240px] gap-4">
              <div className="flex flex-col gap-1">
                {resources.map((resource) => (
                  <NavigationMenuLink
                    className="items-start gap-2"
                    key={resource.label}
                    render={<Link href={resource.href} />}
                  >
                    <resource.icon
                      aria-hidden="true"
                      className="mt-0.5 size-5"
                    />
                    <div className="flex flex-col gap-0.5">
                      <div className="flex items-center gap-2">
                        <span className="font-medium">{resource.label}</span>
                        {resource.badge ? (
                          <Badge variant="secondary">{resource.badge}</Badge>
                        ) : null}
                      </div>
                      <span className="text-muted-foreground">
                        {resource.description}
                      </span>
                    </div>
                  </NavigationMenuLink>
{/* The rest of the file is under Installation. */}

FAQ

How is Video Tutorials marked Free?

Its data has a badge, rendered as a secondary Badge next to the name. Links without one show only the name.

Do Download Free and Register Now do anything?

Not in the demo: they are Buttons with no handler. Link them to your download and registration pages.

What happens on narrow screens?

The panel is w-[600px] 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.

API Reference

Navigation Menu

No extra props in this demo. The rest is on the Navigation Menu page.

Badge

Sets variant="secondary". The rest is on the Badge page.

Button

Sets size="sm". The rest is on the Button page.