Home / Blocks / Marketing / Navbars
5 blocks in this section

Shadcn Navbar Blocks

Site headers built on shadcn/ui: simple, mega-menu, floating, storefront, and a docs header with a collapsing secondary row and breadcrumb.

Jump to a navbar block

5 blocks in this collection

Free Pro

  1. Navbar 1 Free
  2. Navbar 2 Pro
  3. Navbar 3 Pro
  4. Navbar 4 Pro
  5. Navbar 5 Free

How it works

Three steps to working code

Install a block and the files land in your repository. Nothing calls back to us.

  1. terminal

    $ npx shadcn@latest add @shadcnstore/navbar-1

    ✓ Checking registry

    ✓ Installing dependencies

    01

    Run one command

    Every preview above prints its own. The CLI writes the block and the components it needs into your project.

    Installation docs
  2. your project 3 files added

    components/

    ├─ ui/

    ├─ button.tsx

    └─ navigation-menu.tsx

    └─ navbar-1.tsx

    02

    Get real files

    React, TypeScript and Tailwind v4, with no framework imports. Next.js, Vite, Remix and Astro all work.

  3. navbar-1.tsx

    <Menu.Trigger

    - asChild

    + render={<button />}

    />

    03

    Edit it as your own

    Built on Base UI, not Radix, so keyboard and focus behaviour come from the primitive.

Blocks that hold state already carry the use client directive the Next.js App Router needs.

Guide

Working headers, not header screenshots#

A header is the component every page needs and the one most libraries ship as a static picture. These five are built as working navigation, with real active states, a mobile experience that was designed rather than hidden, and keyboard behaviour handled by the underlying Base UI primitives instead of reimplemented.

Five navbars, five different jobs#

  • Navbar 1 (simple): logo, links, one solid call to action, and a sheet menu on mobile. Hierarchy comes from spacing and weight alone, with no accent surface except the button.
  • Navbar 2 (mega menu): Product, Solutions and Resources flyouts built on shadcn/ui Navigation Menu, each item an icon, label and short description, plus an optional featured card. On mobile every flyout becomes an accordion group so no destination disappears.
  • Navbar 3 (floating): transparent and full width over the hero, condensing into a rounded floating bar with a blurred background once the page scrolls. An IntersectionObserver sentinel drives the state, so it never flickers at the threshold.
  • Navbar 4 (storefront): utility bar, category links, collapsing search, account menu, and a cart button whose count is real state feeding a drawer with quantity steppers, a running subtotal and an empty state.
  • Navbar 5 (docs): a documentation header whose secondary row collapses into a breadcrumb on scroll, with a real ⌘K search palette, version switching and a persistent sidebar sheet — the same header our own /docs site runs on.

Types of site header#

  • Simple: a logo, a short link set and one action, where the menu fits without grouping.
  • Mega menu: grouped flyouts with descriptions, once there are more destinations than a dropdown can hold legibly.
  • Floating: transparent over a full-bleed hero, condensing on scroll, for a marketing page built around one image.
  • Storefront: a utility bar, categories, search, an account menu and a cart, which is four jobs a marketing header never has.
  • Documentation: a secondary row that collapses into a breadcrumb, with search and version switching.

When a mega menu is the right answer#

Past about seven top-level destinations, a plain menu stops being scannable and a dropdown of fifteen items is worse. A mega menu groups them under headings and gives each item a one-line description, which is what lets somebody choose without opening three of them first. Below seven, it is overhead nobody needed.

Sticky headers and the space they cost#

A sticky header keeps navigation reachable and permanently takes a strip of a phone screen. The floating variant is the compromise: full height over the hero, condensed once the page scrolls, so it costs less exactly when there is more content to read. Whatever you choose, give in-page anchor targets a scroll margin, or every jump link lands with its heading hidden behind the header.

Mobile navigation is designed, not hidden#

Every variant states its mobile pattern. Navigation collapses into a sheet with larger touch targets, links close the sheet on navigate, calls to action are pinned as full-width actions at the bottom, and grouped menus become accordions rather than being dropped from the markup entirely.

Keyboard and screen reader behaviour#

Headers use real header and nav landmarks with labels, the current page carries aria-current="page", focus rings are left intact, and overlays trap focus and close on Escape through Base UI. The storefront cart announces count changes through a polite live region instead of relying on the badge alone.

Compose the header into a full page#

Put a hero section directly below the header and a footer at the end of the page, and add an announcement banner above the header when you have something to launch. The storefront variant is built to sit on top of the storefront hero.

Header code you can actually edit#

React, TypeScript and Tailwind CSS, composed from shadcn/ui Button, Sheet, Navigation Menu, Accordion, Badge, Input and Dropdown Menu. Menu contents live in a typed data file, so the whole information architecture changes in one place.

FAQ

Navbars questions, answered

What people ask before choosing a block from this collection.

Run the shadcn CLI command shown on each block, for example npx shadcn@latest add @shadcnstore/navbar-1. The command installs the navbar file plus every shadcn/ui component it depends on into your own project, so the code is yours to edit. Full setup steps are in the installation docs.
Navbar 1 if the product has a short menu, because hierarchy comes from spacing and one solid call to action. Navbar 2 once you have more than about seven destinations, because the mega menu groups them with an icon, a label and a one-line description instead of a long dropdown. Navbar 3 suits pages with a full-bleed hero, since it starts transparent and condenses into a floating bar on scroll.
Yes, and the mobile pattern is stated per variant rather than left to chance. Navigation collapses into a sheet with larger touch targets, links close the sheet on navigate, calls to action are pinned as full-width actions at the bottom, and grouped mega-menu flyouts become accordion groups so no destination is dropped from the markup.
Each header uses real header and nav landmarks with labels, marks the current page with aria-current="page", and keeps focus rings intact. Overlays trap focus and close on Escape through the underlying Base UI primitives, and the storefront cart announces count changes through a polite live region instead of relying on the badge alone.
Yes. Navbar 1, the simple marketing header, and Navbar 5, the documentation header this site's own docs run on, are both free. The mega-menu, floating and storefront headers are part of the Pro catalogue. See pricing for what a Pro licence includes.
Yes. Menu contents live in a typed data file next to the component, so the whole information architecture, including mega-menu groups and their descriptions, changes in one place while the layout and behaviour stay intact.

Documentation

The components behind these blocks

How to install, customise and combine the shadcn/ui components this collection is built from.

Free & Premium Templates

Launch Faster with Complete Templates

Love these blocks? Get our free dashboard and landing page templates with 30+ pre-built pages and all the components you need. Premium templates with advanced features launching soon at $69.

Free Templates Now
30+ Pages Included
Premium Coming Soon