Skip to main content
Clever Ops

Pill Dock Navbar

A floating pill nav that hangs centered under the top edge, the active link carries a sliding thumb, and the whole dock condenses on scroll. App-like, not corporate.

Preview & code

Loading Pill Dock Navbar preview

Installation

pnpm dlx shadcn@latest add @cleverui/navbar-pill-dock

Requires the @cleverui registry in your components.json, a one-off, two-line setup.

Usage

tsx
import { NavbarPillDock } from '@/components/blocks/navbar-pill-dock'
Exampletsx
import { NavbarPillDock } from '@/components/blocks/navbar-pill-dock'

export default function NavbarPillDockDemo() {
  return (
    <div className="min-h-[200vh]">
      <NavbarPillDock
        links={[
          { label: 'Work', href: '#work' },
          { label: 'Process', href: '#process' },
          { label: 'Studio', href: '#studio' },
          { label: 'Notes', href: '#notes' },
        ]}
        active="#work"
        cta={{ label: 'Book a call', href: '#contact' }}
      />

      <div className="mx-auto max-w-3xl px-4 pt-32 sm:px-6 sm:pt-36">
        <p className="text-center font-mono text-[11px] uppercase tracking-[0.2em] text-muted-foreground sm:text-xs">
          Field & Form Studio
        </p>
        <h1 className="mt-4 text-center text-balance text-4xl font-semibold tracking-tight sm:text-5xl">
          A floating pill dock that condenses as you read.
        </h1>
        <p className="mx-auto mt-6 max-w-md text-center text-base leading-relaxed text-muted-foreground">
          The active segment rides a sliding thumb. Scroll past eighty pixels and the dock tightens,
          still fully keyboard-reachable, still forty-four pixels tall.
        </p>

        <div className="mt-20 space-y-6">
          {[
            {
              title: 'Selected work',
              body: 'Brand systems and product surfaces for teams shipping under real constraints, not pitch decks.',
            },
            {
              title: 'How we work',
              body: 'Two-week discovery sprints, a single design lead, and engineering partners who stay through launch.',
            },
            {
              title: 'The studio',
              body: 'Eight people across product design, type, and front-end. No account managers, no markup on tools.',
            },
          ].map((block) => (
            <article
              key={block.title}
              className="rounded-2xl border border-border/60 bg-card p-6 sm:p-8"
            >
              <h2 className="text-lg font-semibold tracking-tight text-foreground">{block.title}</h2>
              <p className="mt-2 text-sm leading-relaxed text-muted-foreground sm:text-base">
                {block.body}
              </p>
            </article>
          ))}
        </div>
      </div>
    </div>
  )
}

API reference

NavbarPillDock accepts the following props.

PropTypeDefaultDescription
links*{ label: string; href: string }[]3–6 primary destinations
activestringhref of the active link, defaults to the first link
cta{ label: string; href: string }filled primary segment at the pill's end

…plus everything from React.HTMLAttributes<HTMLElement>: className, event handlers, aria attributes and the rest pass straight through.

Frequently asked questions

How do I install the Pill Dock Navbar component?

Register the @cleverui registry in your components.json ("@cleverui": "https://cleverops.com.au/r/{name}.json"), then run `npx shadcn@latest add @cleverui/navbar-pill-dock`. The shadcn CLI copies the source into your project, you own the code from that point. You can also copy the source directly from this page.

What dependencies does Pill Dock Navbar require?

Pill Dock Navbar uses motion on top of React and Tailwind CSS. You don't need to install it manually, the shadcn CLI resolves and installs npm dependencies automatically when you add the component.

Can I theme Pill Dock Navbar to match my brand?

Yes. The component is styled entirely with Tailwind utilities over standard design tokens (primary, background, muted, border), so it inherits your existing shadcn/ui theme automatically. Change your CSS variables and the component follows, no source edits needed for palette, radius, or fonts.

Want this built for you?

CleverUI is built by the Clever Ops web team. If you'd rather ship a hand-coded, fast, custom website than assemble one, we build them for Australian businesses every week.

Explore web development services