Sidebar Drawer Navbar

About this block

Sidebar Drawer NavbarPRO

Navbar with slide-in sidebar drawer featuring grouped navigation sections and overlay backdrop. Perfect for content-rich sites wanting organized off-canvas navigation menus.

Navbar for content-rich sites that want their full navigation off-canvas: a slim top bar shows only the logo, up to four links, and action buttons, while a hamburger opens a full-height slide-in drawer with grouped, titled sections for everything else.

Upgrade to Pro

Pro blocks install through the shadcn CLI with your license key and ship their full source. Docs and live previews stay open to everyone, so you can read every block's details first.

Upgrade Now

Installation

Swap YOUR_EMAIL and YOUR_KEY for the email and license key on your account. Find your license key on your account page.

Radix flavor

bash
npx shadcn add "https://ui.beste.co/r/navbar34?email=YOUR_EMAIL&license_key=YOUR_KEY"

Base UI flavor

bash
npx shadcn add "https://ui.beste.co/r-base/navbar34?email=YOUR_EMAIL&license_key=YOUR_KEY"

This installs the block to components/beste/block/navbar34.tsx and the shadcn/ui dependency it needs (button).

Quick start

The installed file exports navbar34Demo alongside the block: the exact props behind the preview above. Spread it to get a working navbar in one line.

tsx
import { Navbar34, navbar34Demo } from "@/components/beste/block/navbar34";

export default function Layout() {
  return <Navbar34 {...navbar34Demo} />;
}

Then replace the demo with your own props. Written out, a trimmed setup looks like this:

tsx
import { Navbar34 } from "@/components/beste/block/navbar34";

export default function Layout() {
  return (
    <Navbar34
      logo={{ text: "Acme", href: "/" }}
      navSections={[
        { items: [{ label: "Home", href: "/" }, { label: "Blog", href: "/blog" }] },
        {
          title: "Company",
          items: [
            { label: "Careers", href: "/careers" },
            { label: "Contact", href: "/contact" },
          ],
        },
      ]}
      actionButtons={[{ label: "Get started", href: "/signup" }]}
      sidebarPosition="left"
    />
  );
}

Props

PropTypeDefaultDescription
logo{ text: string; href?: string }–Brand text and link; falls back to "Brand" / # when omitted
navSectionsNavSection[][]Grouped nav links shown inside the drawer; only the first section's first 4 items also appear inline in the top bar
actionButtonsArray<{ label: string; href?: string; variant?: "default" | "outline" | "ghost" }>[]Buttons shown in the desktop top bar and repeated in the drawer footer
sidebarPosition"left" | "right""left"Which edge the hamburger button and the drawer itself are anchored to
classNamestring–Extra classes for the outer <nav>
ts
type NavSection = { title?: string; items: NavItem[] };

type NavItem = { label: string; href?: string; icon?: React.ReactNode };

Behavior notes

  • Only navSections[0]'s first four items appear inline in the desktop top bar; every section (including titled ones), any items past the fourth, and the full nav always live in the drawer only.
  • The hamburger button sits on the same edge as sidebarPosition, and the drawer slides in from that same edge, capped at w-80 and 85vw on narrow screens, with a translate-x transition.
  • Opening the drawer sets document.body.style.overflow = "hidden" to lock background scroll, restored automatically on close or unmount.
  • A full-screen blurred backdrop (bg-background/80 backdrop-blur-sm) closes the drawer on click; clicking any link inside the drawer also closes it.
  • Section titles render only when title is set, as an uppercase muted label above that group's items; each NavItem can carry an arbitrary icon node rendered before its label.

More Navigation blocks

View all Navigation
PRO

navbar49

Drawer Navbar

PRO

navbar64

Fullscreen Overlay Navbar

PRO

navbar40

Breadcrumb Navbar

Get Pro access