Skip to content

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

Dashboard-style with Stats Navigation Menu for Ark UI

An Analytics dropdown with Active Users, Revenue, Conversions, and Bounce Rate above two columns of report links.

The bar shows Analytics. The panel leads with four stat cards, Active Users, Revenue, Conversions, and Bounce Rate, each with a trend badge, then two columns of report links.

Show the numbers in the menu when people pick a report from the headline stats. A Card on the dashboard can carry the chart itself. In React, Ark UI closes the open panel when you press Escape.

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>Analytics</NavigationMenuTrigger>
        <NavigationMenuContent>
          <div className="flex w-[700px] max-w-full flex-col gap-6 p-4">
            <div className="grid grid-cols-4 gap-4">
              {stats.map((stat) => (
                <div
                  className="rounded-lg border bg-card p-4"
                  key={stat.label}
                >
                  <div className="flex items-center justify-between">
                    <stat.icon
                      aria-hidden="true"
                      className="size-4 text-muted-foreground"
                    />
                    <Badge variant={stat.trendVariant}>
                      <stat.trendIcon
                        aria-hidden="true"
                        data-icon="inline-start"
                      />
                      {stat.trend}
                    </Badge>
                  </div>
                  <div className="mt-3">
                    <div className="font-bold text-2xl">{stat.value}</div>
                    <p className="text-muted-foreground text-xs">
                      {stat.label}
                    </p>
{/* The rest of the file is under Installation. */}

FAQ

How are the trends shown?

Each stat has a trend value, an arrow icon and a Badge variant in the data: secondary with an up arrow for gains, destructive with a down arrow for the bounce rate.

Are the stat cards links?

No, only the reports below are NavigationMenuLinks. The figures are written in the file; in an app, load them when the panel opens.

What happens on narrow screens?

The panel is w-[700px] 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 asChild, and the demo puts the Next.js Link inside it.

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.

API Reference

Navigation Menu

Sets asChild. The rest is on the Navigation Menu page.

Badge

Sets variant={stat.trendVariant}. The rest is on the Badge page.