Command Palette Navbar

Command Palette

Type a command or search...

About this block

Command Palette NavbarPRO

Developer-focused navbar with Cmd+K command palette for keyboard-driven navigation and actions. Perfect for developer tools, documentation sites, and power-user applications.

A developer-tool style navbar built around a Cmd+K / Ctrl+K command palette instead of a wide link list. Desktop shows a short primary nav plus a search-looking trigger button with a ⌘K hint; clicking it (or the keyboard shortcut) opens a CommandDialog listing commandItems grouped by category, with fuzzy filtering and optional keyboard shortcut badges baked in by the underlying shadcn Command primitive.

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/navbar39?email=YOUR_EMAIL&license_key=YOUR_KEY"

Base UI flavor

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

This installs the block to components/beste/block/navbar39.tsx and the shadcn/ui dependencies it needs (button, command).

Quick start

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

tsx
import { Navbar39, navbar39Demo } from "@/components/beste/block/navbar39";

export default function Layout() {
  return <Navbar39 {...navbar39Demo} />;
}

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

tsx
import { Navbar39 } from "@/components/beste/block/navbar39";

export default function Layout() {
  return (
    <Navbar39
      logo={{ text: "CmdNav", href: "/" }}
      navItems={[
        { label: "Docs", href: "/docs" },
        { label: "Components", href: "/components" },
      ]}
      commandItems={[
        { label: "Home", href: "/", category: "Pages", shortcut: "H" },
        { label: "Documentation", href: "/docs", category: "Pages", shortcut: "D" },
        { label: "GitHub", href: "https://github.com", category: "Links" },
      ]}
      searchPlaceholder="Type a command or search..."
      buttons={[{ label: "Get Started", variant: "default", href: "/signup" }]}
    />
  );
}

Props

PropTypeDefaultDescription
logo{ text: string; href?: string }Brand text and link, shown at the left
navItemsNavItem[][]Short primary nav links, shown next to the logo
commandItemsCommandItemProps[][]Entries listed inside the command palette, grouped by category
searchPlaceholderstring"Type a command or search..."Placeholder for both the trigger button label context and the palette's search input
buttonsArray<{ label: string; href?: string; variant?: "default" | "outline" | "ghost" }>[]Action buttons rendered right of the search trigger, repeated in the mobile panel
classNamestringExtra classes for the outer <nav>
ts
type NavItem = { label: string; href?: string };

type CommandItemProps = {
  label: string;
  href?: string;
  category?: string;
  shortcut?: string;
};

Items with no category are grouped under "Other".

Behavior notes

  • A keydown listener on document opens the palette on Cmd+K (Mac) or Ctrl+K (other platforms), calling preventDefault() so the browser's own shortcut doesn't fire; the listener is attached once via useEffect and cleaned up on unmount.
  • The visible ⌘K trigger button (desktop, lg and up) and a plain icon button (below lg) both just call setCommandOpen(true); the dialog itself is the shared shadcn CommandDialog.
  • commandItems are grouped client-side by category using reduce, so palette sections reflect whatever categories are present in the data, in first-seen order.
  • Selecting a command item closes the dialog and navigates via window.location.href (a full page load, not client-side routing), which also fires for items without a category or shortcut.
  • Desktop nav links and buttons show at md and above; below that a hamburger toggles a conditionally rendered mobile panel ({mobileMenuOpen && ...}) with stacked links and full-width buttons, separate from the command palette.

More Navigation blocks

View all Navigation
PRO

navbar32

Search-Focused Navbar

Navbar with prominent search input, navigation links, and action button for search-driven experiences. Perfect for marketplaces, directories, and content platforms prioritizing discovery.

PRO

navbar68

Command Search Navbar

Search-forward navbar — a wide rounded search field sits at the center with an animated submit seal, framed by the wordmark, quiet links and a pill CTA.

PRO

navbar71

Pill Menu Navbar

A light editorial navbar with a lowercase wordmark, soft muted nav pills that reveal hover dropdowns, a solid accent call to action, and a collapsing mobile menu.

PRO

navbar36

Tab-Style Navbar

Navbar with tab-style navigation supporting underline or pill active states for app-like navigation. Perfect for dashboards and admin panels with section-based interfaces.

PRO

navbar74

Floating Capsule Navbar

A navbar contained in a softly rounded, bordered capsule with a lowercase wordmark, uppercase links, an accent call to action, and a matching mobile panel.

PRO

navbar58

Monogram Navbar

Minimal stacked navbar — a large primary logo square with the wordmark tucked into its corner, over a quiet ruled row of uppercase links. No buttons, no hamburger.