Automate Flows w/ Troy

Liquid Glass Contour Navigation

Navigation 23

About

A liquid glass section bar. One line runs along the glass and rises into a rounded dome around the current icon and label. Includes a scroll-spy hook for long pages. Tune frost, opacity, refraction and contour height.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Liquid Glass Contour Navigation to your project and fits it to your theme.

Code

How Liquid Glass Contour Navigation is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import { useState, type MouseEvent } from "react";
import { BookOpen, Building2, Eye, Layers, Palette, Sun } from "lucide-react";
import "@fontsource-variable/manrope";
import LiquidGlassContourNavigation, {
  type ContourItem,
} from "@/components/ui/liquid-glass-contour-navigation";

const settings = {
  frost: 8,
  glassOpacity: 0.58,
  refraction: 16,
  edgeLight: 1,
  contourHeight: 0.8,
  stretch: 0.5,
};

const items: ContourItem[] = [
  { id: "overview", href: "#overview", label: "Overview", icon: <Eye /> },
  { id: "materials", href: "#materials", label: "Materials", icon: <Layers /> },
  { id: "light", href: "#light", label: "Light", icon: <Sun /> },
  { id: "colour", href: "#colour", label: "Colour", icon: <Palette />, badge: "updated this week" },
  { id: "structure", href: "#structure", label: "Structure", icon: <Building2 /> },
  { id: "reading", href: "#reading", label: "Reading", icon: <BookOpen /> },
];

// Photo: Walt Disney Concert Hall, Tobias Keller on Unsplash. A light scrim in the theme background colour keeps it in step with light and dark mode.
const demoStyles = `
.stage { font-family: "Manrope Variable", Manrope, system-ui, sans-serif; }
.stage-field {
  background: var(--color-muted) url("https://cdn.21st.dev/assets/mirror/59/5974bd7c740f8b28fa00efa5bf448747d2c0fa8e769b096e2605e6f546c9b714.jpg") center / cover no-repeat;
}
.stage-scrim {
  background: linear-gradient(180deg, color-mix(in srgb, var(--color-background) 30%, transparent), color-mix(in srgb, var(--color-background) 8%, transparent) 55%, color-mix(in srgb, var(--color-background) 22%, transparent));
}
`;

export default function LiquidGlassContourNavigationDemo(props: Partial<typeof settings> = {}) {
  const s = { ...settings, ...props };
  const [activeId, setActiveId] = useState("light");

  const onNavigate = (item: ContourItem, event: MouseEvent<HTMLAnchorElement>) => {
    event.preventDefault();
    setActiveId(item.id);
  };

  return (
    <main className="stage grid h-svh min-h-[360px] w-full place-items-center bg-background p-4 text-foreground sm:p-6">
      <style>{demoStyles}</style>
      <div className="stage-field relative isolate grid h-full max-h-[520px] w-full max-w-[920px] place-items-center overflow-hidden rounded-3xl border border-border px-3 sm:px-6">
        <div className="stage-scrim absolute inset-0 -z-10" aria-hidden="true" />
        <div className="w-full min-w-0 max-w-[680px]">
          <LiquidGlassContourNavigation
            items={items}
            activeId={activeId}
            onNavigate={onNavigate}
            label="Guide sections"
            contourHeight={s.contourHeight * 1.25}
            effects={{ stretch: s.stretch }}
            glass={{ blur: s.frost, opacity: s.glassOpacity, edge: s.edgeLight, distortion: s.refraction }}
          />
        </div>
      </div>
    </main>
  );
}

Dependencies

More by Automate Flows w/ Troy

View all
  • Business/Sales Dashboard

    Business/Sales Dashboard

    1.5K
  • Adjustable Glass Dashboard

    Adjustable Glass Dashboard

    1.3K
  • Interactive Workflow Blueprint

    Interactive Workflow Blueprint

    707
  • Glassy Coverflow Carousel

    Glassy Coverflow Carousel

    450
  • Liquid Glass Expandable Sidebar

    Liquid Glass Expandable Sidebar

    432
  • Liquid Glass Footer

    Liquid Glass Footer

    282
  • Dimensional Workflow Hero

    Dimensional Workflow Hero

    209
  • KNOCKOUT Landing Page

    KNOCKOUT Landing Page

    192

More in Navigation

View all
  • Footer with Big Wordmark

    Footer with Big Wordmark

    162
  • Meniscus — Liquid Bottom Navigation Bar

    Meniscus — Liquid Bottom Navigation Bar

    27
  • Sidebar

    Sidebar

    441
  • Tabs

    Tabs

    38
  • Footer Section

    Footer Section

    2
  • Sidebar

    Sidebar

    366
  • Pagination

    Pagination

    119
  • Pagination with Ellipsis

    Pagination with Ellipsis

    31