Skip to content

Navbar Dock

macOS-style floating bottom dock: a glass pill of round icon links that magnify with a spring when hovered (neighbours too), tooltips, a gradient active item with dot and an ink CTA.

glass/section/navbar-dock
Open ↗

Source

"use client";

import { useState } from "react";
import { motion, useReducedMotion } from "motion/react";
import { Home, LayoutGrid, MessageCircle, Sparkles, Tag, type LucideIcon } from "lucide-react";
import { cn } from "@/lib/utils";

export interface NavbarDockItem {
  label: string;
  href: string;
  icon: LucideIcon;
}

export interface NavbarDockProps {
  items?: NavbarDockItem[];
  activeHref?: string;
  cta?: { label: string; href: string };
  /** fixed: pinned to the viewport bottom; static: in flow (previews, footers). */
  position?: "fixed" | "static";
  className?: string;
}

const DEFAULT_ITEMS: NavbarDockItem[] = [
  { label: "Home", href: "#home", icon: Home },
  { label: "Features", href: "#features", icon: Sparkles },
  { label: "Integrations", href: "#integrations", icon: LayoutGrid },
  { label: "Pricing", href: "#pricing", icon: Tag },
  { label: "Contact", href: "#contact", icon: MessageCircle },
];

/** Floating bottom dock (macOS-style): glass pill of icon buttons that magnify on hover, labels in tooltips, sliding active dot, gradient CTA. */
export function NavbarDock({
  items = DEFAULT_ITEMS,
  activeHref = "#home",
  cta = { label: "Try free", href: "#signup" },
  position = "fixed",
  className,
}: NavbarDockProps) {
  const reduce = useReducedMotion();
  const [hover, setHover] = useState<number | null>(null);

  const scale = (i: number) => {
    if (reduce || hover === null) return 1;
    const d = Math.abs(hover - i);
    return d === 0 ? 1.35 : d === 1 ? 1.12 : 1;
  };

  return (
    <nav
      aria-label="Main"
      className={cn(position === "fixed" ? "fixed inset-x-0 bottom-5 z-40" : "relative", "flex justify-center px-4 text-da-fg", className)}
    >
      <ul
        onMouseLeave={() => setHover(null)}
        className="da-stroke flex items-end gap-1 rounded-da-pill bg-da-surface p-2 shadow-da-lg backdrop-blur-da backdrop-saturate-150"
      >
        {items.map((it, i) => {
          const active = it.href === activeHref;
          return (
            <li key={it.href} className="relative">
              <motion.a
                href={it.href}
                aria-current={active ? "page" : undefined}
                onMouseEnter={() => setHover(i)}
                onFocus={() => setHover(i)}
                onBlur={() => setHover(null)}
                animate={{ scale: scale(i), y: scale(i) > 1 ? -4 * (scale(i) - 1) * 10 : 0 }}
                transition={{ type: "spring", stiffness: 400, damping: 22 }}
                className={cn(
                  "da-focus group relative grid size-11 origin-bottom place-items-center rounded-full",
                  active
                    ? "bg-gradient-to-br from-da-primary to-da-accent text-da-primary-fg shadow-da-sm"
                    : "bg-da-surface-2 text-da-muted-fg hover:text-da-fg",
                )}
              >
                <it.icon aria-hidden className="size-5" />
                <span className="sr-only">{it.label}</span>
                <span
                  aria-hidden
                  className="da-stroke pointer-events-none absolute -top-9 left-1/2 -translate-x-1/2 rounded-da-pill bg-da-surface px-2.5 py-1 text-xs font-medium whitespace-nowrap text-da-fg opacity-0 shadow-da-sm backdrop-blur-da transition-opacity duration-(--da-duration) group-hover:opacity-100 group-focus-visible:opacity-100"
                >
                  {it.label}
                </span>
              </motion.a>
              {active && <span aria-hidden className="absolute -bottom-1.5 left-1/2 size-1 -translate-x-1/2 rounded-full bg-da-fg" />}
            </li>
          );
        })}
        <li className="ml-1 border-l border-da-border-strong pl-2">
          <a
            href={cta.href}
            className="da-focus da-transition inline-flex h-11 items-center rounded-da-pill bg-da-fg px-4 text-sm font-semibold whitespace-nowrap text-da-bg hover:-translate-y-0.5"
          >
            {cta.label}
          </a>
        </li>
      </ul>
    </nav>
  );
}

export default NavbarDock;

modules/glass/section/navbar-dock/index.tsx

Props

PropTypeDefaultDescription
items{ label, href, icon }[]—Links.
activeHrefstring"#home"Current.
cta{ label, href }—CTA.
position"fixed" | "static""fixed"Pinned to viewport bottom or in flow.
classNamestring—Classes.

Other navbar variants in Glass

Navbar in other art directions

Navbar Bold

Sticky top bar with square logo mark, mono uppercase links, underlined login and a pressable yellow CTA. Collapses into a full-width stacked menu on mobile.

BrutalistNavbar

Navbar Centered

Boxed navbar card with a hard shadow: links split left and right around a tilted yellow wordmark sticker in the center, ink CTA pressing into its shadow. Mobile opens a two-column ruled menu grid.

BrutalistNavbar

Navbar Overlay

Minimal bar (wordmark + ink MENU button with animated burger) that opens a full-screen yellow overlay with giant numbered links sliding on hover, a contact line and CTA. Same menu on every screen size.

BrutalistNavbar

Navbar Ticker

Two-tier sticky header: a scrolling ink announcement ticker on top, then a ruled bar where every link is a full-height cell that floods yellow on hover and a blue CTA block on the right.

BrutalistNavbar

Navbar Announcement

Two-tier header: a dismissible ink announcement bar with a link, above a hairline navbar with links, a ⌘K search trigger (wired to onSearch) and log in / demo actions.

MinimalNavbar

Navbar Blur

Sticky 56px top bar that is transparent at the top of the page and turns into a translucent blurred bar with a hairline once scrolled. Muted links, ink CTA, compact mobile menu.

MinimalNavbar

Navbar Mega

Navbar with a full-width Product mega menu: six icon + description items in a 3-column grid and a featured launch card, closes on outside click and Escape; grouped mobile menu.

MinimalNavbar

Navbar Pill

Floating, centered pill navbar with backdrop blur: logo, links with a shared hover/active pill indicator, ink CTA; collapses into a dropdown sheet with Escape support on mobile.

MinimalNavbar

Navbar Fullscreen

Minimal bar (logo + “Menu”) that opens a full-screen ink overlay with giant stacked links sliding up line by line, mono notes and contact details; Escape closes and scroll is locked.

Mono CleanNavbar

Navbar Index

Studio-style index navbar: numbered links “(01) Work”, a live local clock with city in mono, availability dot in the signal color and an underlined text CTA; stacked list on mobile.

Mono CleanNavbar

Navbar Meta

Two-tier editorial header: a mono meta strip (version, status with signal dot, changelog link) over a nav bar closed by a full-ink rule; oversize logo wordmark on desktop; stacked menu on mobile.

Mono CleanNavbar

Navbar Mono

Clean monochrome navbar on a hairline: square logo, links whose underline wipes in on hover (orange dot marks the active one), text sign-in and an ink button; text “Menu/Close” toggle opens a ruled list on mobile.

Mono CleanNavbar

Navbar Corporate

Corporate navbar: logo, two dropdown menus (items with descriptions), plain links, “Sign in”, bordered “Contact sales” and a blue primary; mobile accordion menu.

Neo CorporateNavbar

Navbar Mega

Navbar with a wide “Platform” mega menu: three titled columns of icon links plus a navy promo card, closing on Escape/outside click; stacked on mobile.

Neo CorporateNavbar

Navbar Scroll

Sticky navbar that starts tall and transparent and condenses on scroll into a white bordered bar with a subtle shadow and a smaller CTA.

Neo CorporateNavbar

Navbar Utility

Two-tier enterprise header: a slim surface-2 utility bar (system status, sales phone, language select, support/login) above the main navbar.

Neo CorporateNavbar

Navbar Announce

Sage announcement strip (leaf icon, message, link, dismiss) above a simple cream navbar with a terracotta-tinted secondary pill and sage primary pill; drop-down menu on mobile.

Organic SoftNavbar

Navbar Floating

Floating pill navbar: a rounded, softly blurred surface bar detached from the top edge, with centered links and an arrow CTA; expands into a rounded panel on mobile.

Organic SoftNavbar

Navbar Organic

Calm cream navbar: round leaf logo + serif wordmark, links with a hand-drawn underline on the active one, text sign-in and a sage pill CTA; rounded sheet menu on mobile.

Organic SoftNavbar

Navbar Split

Editorial symmetric navbar: links split on both sides of a centered logo + large serif wordmark, a thin warm rule below, outlined pill CTA; full-width stacked menu on mobile.

Organic SoftNavbar

Navbar Centered

Symmetric navbar inside a soft rounded well: links split left and right of a centered wordmark with two overlapping dots, ink pill CTA at the far right; stacked sheet on mobile.

Soft FlatNavbar

Navbar Sheet

Minimal bar with a wordmark and a big “Menu” pill that unfolds a grid of pastel link tiles (title, description, arrow) with a staggered bouncy entrance, on every screen size.

Soft FlatNavbar

Navbar Soft

Friendly sticky navbar: rounded pastel logo mark, pill links with a soft lavender active fill, text log-in and a periwinkle pill CTA; rounded drop-down sheet on mobile.

Soft FlatNavbar

Navbar Tabs

Two-row header: brand and CTA on top, then a horizontally scrollable strip of pill tabs with emoji where the active tab is an ink-filled pill.

Soft FlatNavbar