Docs Navbar

About this block

Docs NavbarPRO

A documentation bar with a wordmark and version pill, a Docs trigger that drops a two-column card of described links, plain links, a search trigger styled like an input with a keyboard hint, a theme button and a ghost GitHub link. On phones a left drawer slides in with a collapsible section tree. The dropdown and the drawer stay in the markup and are toggled with CSS.

A documentation bar: wordmark and version pill, a Docs trigger that drops a two-column card of described links, plain links, a search trigger styled like an input with a keyboard hint, a theme button and a ghost GitHub link, with a left drawer and a collapsible section tree on phones.

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://beste.dev/r/navbar90?email=YOUR_EMAIL&license_key=YOUR_KEY"

Base UI flavor

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

This installs the block to components/beste/block/navbar90.tsx plus the shadcn button primitive it uses.

Quick start

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

tsx
import { Navbar90, navbar90Demo } from "@/components/beste/block/navbar90";

export default function Page() {
  return <Navbar90 {...navbar90Demo} />;
}

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

tsx
import { Navbar90 } from "@/components/beste/block/navbar90";

export default function Page() {
  return (
    <Navbar90
      brand="Fieldnote"
      version="v4.2"
      menu={{
        label: "Docs",
        items: [
          { title: "Getting started", description: "Install the CLI and ship your first page.", href: "/docs" },
          { title: "Theming", description: "Tokens, dark mode and the palette.", href: "/docs/theming" },
        ],
      }}
      links={[
        { label: "Components", href: "/components" },
        { label: "Blog", href: "/blog" },
      ]}
      repo={{ label: "GitHub", href: "https://github.com" }}
      tree={[
        {
          title: "Getting started",
          links: [
            { label: "Installation", href: "/docs/install" },
            { label: "First page", href: "/docs/first-page" },
          ],
        },
        { title: "Components", links: [{ label: "Button", href: "/components/button" }] },
      ]}
      labels={{ search: "Search docs", searchHint: "Ctrl K", theme: "Toggle theme", open: "Open menu", close: "Close menu" }}
    />
  );
}

Props

PropTypeDefaultDescription
brandstring–Wordmark on the left
versionstring–Version pill beside the wordmark
menuDropdown–The trigger that opens the two-column dropdown
linksNavItem[][]Plain links beside the trigger
repoNavItem–Ghost link on the right, repeated at the foot of the drawer
treeTreeSection[][]Collapsible sections in the mobile drawer
labels{ search?: string; searchHint?: string; theme?: string; open?: string; close?: string }{}UI strings for the search trigger, the theme button and the menu toggle
classNamestring–Extra classes for the outer <header>
ts
type Dropdown = {
  label: string;
  items: DropdownItem[];
};

type DropdownItem = {
  title: string;
  description: string;
  href: string;
};

type TreeSection = {
  title: string;
  links: NavItem[];
};

type NavItem = {
  label: string;
  href: string;
};

Behavior notes

  • The dropdown and the mobile drawer are server-rendered and always in the markup; CSS classes swap invisible opacity-0 for visible opacity-100 and -translate-x-full for translate-x-0, so every link is in the HTML before any script runs.
  • The Docs trigger opens on hover and on click, carries aria-expanded and aria-controls, and closes on Escape, on a click outside the header (a mousedown listener added in an effect and removed on unmount) and when the pointer leaves the header.
  • The drawer uses the inert attribute while closed so its off-screen links are skipped by the keyboard; a scrim behind it closes the drawer on tap.
  • Tree sections collapse with a grid-rows-[0fr] to grid-rows-[1fr] transition keyed by an expanded record in state; the chevron rotates 180 degrees on the open section, and the first section starts open.
  • The search trigger is a button styled like an input with the hint from labels.searchHint; wire its onClick to your own command palette.
  • Any link inside the drawer closes it on click.

More Navigation blocks

View all Navigation
PRO

navbar71

Pill Menu Navbar

PRO

navbar77

Centred Wordmark Navbar

PRO

navbar73

Announcement Bar Navbar

Get Pro