Skip to content

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-soft/section/navbar-floating
Open ↗

Source

"use client";

import { useEffect, useId, useState } from "react";
import { ArrowRight, Menu, X } from "lucide-react";
import { cn } from "@/lib/utils";

export interface NavbarFloatingProps {
  brand?: string;
  brandHref?: string;
  links?: { label: string; href: string }[];
  cta?: { label: string; href: string };
  className?: string;
}

function GroveMark({ className }: { className?: string }) {
  return (
    <svg aria-hidden viewBox="0 0 32 32" className={cn("size-8 shrink-0", className)}>
      <circle cx="16" cy="16" r="16" fill="var(--da-primary)" />
      <path d="M16 25V13" stroke="var(--da-primary-fg)" strokeWidth="2" strokeLinecap="round" />
      <path d="M16 17c-4 0-6.5-2.6-6.5-6.5 4 0 6.5 2.6 6.5 6.5Z" fill="var(--da-primary-fg)" opacity=".85" />
      <path d="M16 14c3.6 0 6-2.3 6-6-3.6 0-6 2.3-6 6Z" fill="var(--da-primary-fg)" />
    </svg>
  );
}

/** 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. */
export function NavbarFloating({
  brand = "Grove",
  brandHref = "/",
  links = [
    { label: "Measure", href: "#measure" },
    { label: "Reduce", href: "#reduce" },
    { label: "Report", href: "#report" },
    { label: "Pricing", href: "#pricing" },
  ],
  cta = { label: "Book a walk-through", href: "#demo" },
  className,
}: NavbarFloatingProps) {
  const [open, setOpen] = useState(false);
  const id = useId();
  useEffect(() => {
    if (!open) return;
    const onKey = (e: KeyboardEvent) => e.key === "Escape" && setOpen(false);
    window.addEventListener("keydown", onKey);
    return () => window.removeEventListener("keydown", onKey);
  }, [open]);
  return (
    <header className={cn("sticky top-4 z-40 px-4", className)}>
      <nav
        aria-label="Main"
        className={cn(
          "mx-auto flex max-w-4xl flex-wrap items-center gap-4 bg-da-surface/85 py-2 pr-2 pl-4 text-da-surface-fg shadow-da-md backdrop-blur-da da-transition",
          open ? "rounded-da-lg" : "rounded-da-pill",
        )}
      >
        <a href={brandHref} className="da-focus flex items-center gap-2 rounded-da-pill font-da-display text-xl">
          <GroveMark className="size-7" />
          {brand}
        </a>
        <ul className="mx-auto hidden items-center gap-1 md:flex">
          {links.map((l) => (
            <li key={l.href}>
              <a href={l.href} className="da-focus da-transition rounded-da-pill px-4 py-2 text-[15px] text-da-muted-fg hover:bg-da-surface-2 hover:text-da-fg">
                {l.label}
              </a>
            </li>
          ))}
        </ul>
        <a
          href={cta.href}
          className="da-focus da-transition group hidden h-11 items-center gap-2 rounded-da-pill bg-da-primary pr-2 pl-5 text-[15px] font-medium text-da-primary-fg md:inline-flex"
        >
          {cta.label}
          <span
            aria-hidden
            className="grid size-7 place-items-center rounded-full bg-da-primary-fg/15 transition-transform duration-(--da-duration) group-hover:translate-x-0.5"
          >
            <ArrowRight className="size-4" />
          </span>
        </a>
        <button
          type="button"
          aria-label={open ? "Close menu" : "Open menu"}
          aria-expanded={open}
          aria-controls={id}
          onClick={() => setOpen(!open)}
          className="da-focus ml-auto grid size-10 place-items-center rounded-full bg-da-surface-2 md:hidden"
        >
          {open ? <X aria-hidden className="size-5" /> : <Menu aria-hidden className="size-5" />}
        </button>
        <div id={id} hidden={!open} className="w-full pb-2 md:hidden">
          <ul className="grid gap-1 pt-2">
            {links.map((l) => (
              <li key={l.href}>
                <a href={l.href} className="da-focus block rounded-da-md px-3 py-3 text-lg hover:bg-da-surface-2">
                  {l.label}
                </a>
              </li>
            ))}
          </ul>
          <a href={cta.href} className="da-focus mt-2 block rounded-da-pill bg-da-primary py-3 text-center font-medium text-da-primary-fg">
            {cta.label}
          </a>
        </div>
      </nav>
    </header>
  );
}

export default NavbarFloating;

modules/organic-soft/section/navbar-floating/index.tsx

Props

PropTypeDefaultDescription
brandstring—Brand name.
brandHrefstring—Brand link target.
links{ label: string; href: string }[]—Links.
cta{ label: string; href: string }—Cta.
classNamestring—Extra classes on the root.

Other navbar variants in Organic Soft

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 Bar

Full-width sticky frosted bar with a Features dropdown that opens a glass panel of four icon cards, plain links and a gradient pill CTA; stacked mobile menu.

GlassNavbar

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.

GlassNavbar

Navbar Floating

Floating frosted pill navbar detached from the top edge: gradient orb logo, centered links, gradient CTA. On mobile the pill opens a frosted dropdown panel that fades in.

GlassNavbar

Navbar Islands

Three separate floating glass islands — brand pill, centered links pill, actions pill with gradient CTA — that merge into a single button and frosted panel on mobile.

GlassNavbar

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 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