Navbar

Floating pill navigation bar — fixed at the top of the viewport, centered, with frosted-glass backdrop blur. Logo left, nav links center, optional CTA right. On mobile collapses to a hamburger that opens a slide-in drawer.

MyApp

Installation

npm install @bloomkit/react

Usage

import { Navbar } from "@bloomkit/react";
 
<Navbar
  logo={<span>MyApp</span>}
  links={[
    { label: "Features", href: "/features" },
    { label: "Docs", href: "/docs", active: true },
    { label: "Blog", href: "/blog" },
  ]}
  cta={<Button size="sm">Get started</Button>}
/>

Logo only

Minimal setup — just a logo, no links or CTA.

MyApp
<Navbar logo={<span>MyApp</span>} />

Controlled drawer

By default the mobile drawer manages its own open state. Pass drawerOpen and onDrawerOpenChange to control it from outside.

const [open, setOpen] = useState(false);
 
<Navbar
  logo={<span>MyApp</span>}
  links={[{ label: "Docs", href: "/docs" }]}
  drawerOpen={open}
  onDrawerOpenChange={setOpen}
/>

Custom mobile drawer

Use drawerContent to replace the auto-generated link list with anything you want inside the mobile drawer.

<Navbar
  logo={<span>MyApp</span>}
  drawerContent={
    <div className="flex flex-col gap-4">
      <a href="/features">Features</a>
      <a href="/pricing">Pricing</a>
      <Button variant="primary">Get started</Button>
    </div>
  }
/>

Offset

Control the gap between the pill and the top of the viewport with offsetTop (default 20px).

<Navbar logo={<span>MyApp</span>} offsetTop={32} />

Props

PropTypeDefaultDescription
logoReactNodeBrand mark — text, image, SVG, or any component. Rendered on the left.
linksNavbarLink[][]Nav links shown center on desktop and listed in the mobile drawer
ctaReactNodeCTA rendered right of links on desktop, at the bottom of the mobile drawer
drawerContentReactNodeCustom mobile drawer body. Overrides the auto-generated link list when set
drawerOpenbooleanControlled open state of the mobile drawer
onDrawerOpenChange(open: boolean) => voidCalled when the mobile drawer open state should change
offsetTopnumber20Distance from the top of the viewport in px
classNamestringExtra Tailwind classes merged onto the pill element
interface NavbarLink {
  label: string;
  href: string;
  active?: boolean; // highlights the link as the current page
}