Skip to main content
BlocksNavbarHeader with centred links and two CTAs

shadcn/ui Navbar blockHeader with centred links and two CTAs

Classic shadcn/ui landing-page header: logo on the left, five links absolutely centred, and ghost "Sign in" plus primary "Start free" Buttons on the right above a thin border. Below md the links collapse into a hamburger Button that opens a left-side Sheet with the same links and CTAs. A good default for any SaaS marketing site.

Free@shadcnpro/navbar-01

Preview

Installation

npx shadcn@latest add @shadcnpro/navbar-01

First time? Add the @shadcnpro registry to components.json as shown in Installation. Free blocks install without a license key.

Let your AI editor install it

The shadcn/ui Pro MCP server lets Cursor, Claude Code and VS Code find and install blocks like Header with centred links and two CTAs from one prompt. It is included in every Pro plan.

Add the shadcn/ui components

Header with centred links and two CTAs uses Button, Sheet and Skeleton.

npx shadcn@latest add button sheet skeleton

Install the npm packages

npm install lucide-react

Copy the code

Paste it into components/blocks/navbar-01.tsx.

components/blocks/navbar-01.tsx
'use client';

import { MenuIcon } from 'lucide-react';

import { Button } from '@/components/ui/button';
import {
  Sheet,
  SheetContent,
  SheetDescription,
  SheetFooter,
  SheetHeader,
  SheetTitle,
  SheetTrigger,
} from '@/components/ui/sheet';
import { Skeleton } from '@/components/ui/skeleton';

const links = ['Product', 'Pricing', 'Docs', 'Blog', 'Customers'];

/**
 * Classic landing-page header: logo left, five links centred, Sign in + Start free right, with a left-side Sheet for mobile.
 */
export default function Navbar01() {
  return (
    <div className="flex min-h-dvh w-full flex-col" data-block>
      <header className="w-full border-b bg-background">
        <div className="relative mx-auto flex h-16 w-full max-w-6xl items-center justify-between px-6">
          <a className="flex items-center gap-2" href="#">
            <img
              alt=""
              className="size-8 rounded-lg object-cover"
              src="/logo.png"
            />
            <span className="font-semibold text-foreground">Lumen</span>
          </a>

          <nav
            aria-label="Main"
            className="-translate-x-1/2 absolute left-1/2 hidden items-center gap-8 md:flex"
          >
            {links.map((link) => (
              <a
                className="font-medium text-muted-foreground text-sm transition-colors hover:text-foreground"
                href="#"
                key={link}
              >
                {link}
              </a>
            ))}
          </nav>

          <div className="hidden items-center gap-2 md:flex">
            <Button type="button" variant="ghost">
              Sign in
            </Button>
            <Button type="button">Start free</Button>
          </div>

          <Sheet>
            <SheetTrigger asChild>
              <Button
                aria-label="Open menu"
                className="md:hidden"
                size="icon"
                type="button"
                variant="ghost"
              >
                <MenuIcon aria-hidden="true" />
              </Button>
            </SheetTrigger>
            <SheetContent className="w-80" side="left">
              <SheetHeader className="border-b">
                <SheetTitle className="flex items-center gap-2">
                  <img
                    alt=""
                    className="size-8 rounded-lg object-cover"
                    src="/logo.png"
                  />
                  Lumen
                </SheetTitle>
                <SheetDescription className="sr-only">
                  Site navigation
                </SheetDescription>
              </SheetHeader>
              <nav aria-label="Mobile" className="flex flex-col gap-1 px-2">
                {links.map((link) => (
                  <a
                    className="rounded-md px-3 py-2 font-medium text-foreground text-sm transition-colors hover:bg-muted"
                    href="#"
                    key={link}
                  >
                    {link}
                  </a>
                ))}
              </nav>
              <SheetFooter>
                <Button type="button" variant="outline">
                  Sign in
                </Button>
                <Button type="button">Start free</Button>
              </SheetFooter>
            </SheetContent>
          </Sheet>
        </div>
      </header>

      {/* Page placeholder so the header reads like the top of a real landing page */}
      <div className="flex flex-1 items-center justify-center bg-muted/40 px-6 py-12">
        <div className="flex w-full max-w-2xl flex-col items-center gap-4">
          <Skeleton className="h-4 w-32 rounded-full bg-muted-foreground/15" />
          <Skeleton className="h-10 w-full bg-muted-foreground/15" />
          <Skeleton className="h-10 w-3/4 bg-muted-foreground/15" />
          <Skeleton className="mt-2 h-4 w-2/3" />
          <div className="mt-4 flex gap-3">
            <Skeleton className="h-10 w-32 rounded-full bg-muted-foreground/15" />
            <Skeleton className="h-10 w-32 rounded-full bg-muted-foreground/15" />
          </div>
        </div>
      </div>
    </div>
  );
}

Use it

Import it where you need it and update the import path to match your project.

Usage
import Navbar01 from '@/components/blocks/navbar-01';

export default function Page() {
  return <Navbar01 />;
}

Overview

Header with centred links and two CTAs is a free navbar block for shadcn/ui. It is built from the Button, Sheet and Skeleton components with lucide-react, and installs as a single file you own and can edit.

It only uses semantic tokens such as bg-background, text-muted-foreground and border-border, so it follows your theme, radius and fonts and switches with dark mode. It is responsive from desktop to mobile; the width controls above the preview show each size. The same layout is in the shadcn/ui Pro Figma kit, so design and code start from one source.

Category
Navbar
Component library
Radix UI (radix-ui)
Also available for
Base UI, React Aria
Built with
Button, Sheet and Skeleton
npm packages
lucide-react
Files
components/blocks/navbar-01.tsx
Access
Free, installs without a license key

Frequently asked questions

Pricing, installation and Radix UI details for Header with centred links and two CTAs.