Automate Flows w/ Troy

Liquid Glass Notched Dock

Navigation 2

About

A liquid glass bottom dock whose rim opens into a notch under the current destination. The active icon rides in a bubble that slides and stretches to the next one while labels stay put. Tune frost, tint, refraction and notch depth.

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

Code

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

Usage.tsx

"use client";

import { useEffect, useState, type MouseEvent } from "react";
import { Aperture, Images, Layers, Plus, UserRound, Users } from "lucide-react";
import "@fontsource-variable/manrope";
import LiquidGlassNotchedDock, { type DockItem } from "@/components/ui/liquid-glass-notched-dock";

const settings = {
  frost: 3,
  tint: 0.16,
  refraction: 20,
  edgeLight: 1,
  notchDepth: 0.8,
};

const destinations: DockItem[] = [
  { id: "library", href: "#library", label: "Library", icon: <Images /> },
  { id: "albums", href: "#albums", label: "Albums", icon: <Layers /> },
  { id: "import", href: "#import", label: "Import", icon: <Plus /> },
  { id: "shared", href: "#shared", label: "Shared", icon: <Users />, badge: "2 new shared albums" },
  { id: "you", href: "#you", label: "You", icon: <UserRound /> },
];

// Demo content only. Photos are from Unsplash; each alt text names its photographer.
const photos = [
  { id: "1714659046816-33cddc1cbe81", alt: "Orange wall behind a steel pole, by Artur Adilkhanian" },
  { id: "1594548044919-75fd146b8c60", alt: "Blue shuttered window on a white wall, by Victor" },
  { id: "1576165767735-aaf2b2bbe6f1", alt: "Green and pink houses side by side, by Marcus Lenk" },
  { id: "1665659097304-9f216fa37c0c", alt: "Roller coaster track against a blue sky, by Sergey Kvint" },
  { id: "1604021633886-3172adc67ae2", alt: "Red and white striped facade, by Jei Lee" },
  { id: "1696075619078-6cb640d329ec", alt: "Cactus in front of a terracotta wall, by Lena Polishko" },
  { id: "1657128209289-8abffccb9aac", alt: "Yellow building with a single window, by Andrea Music" },
  { id: "1624012040556-c47bc555c39e", alt: "Metal facade corner against a violet sky, by Meritt Thomas" },
  { id: "1714659046842-7dcf4ab2a58f", alt: "Orange building beside a street light, by Artur Adilkhanian" },
  { id: "1601883165851-208729ce4b55", alt: "Brick wall in brown and white, by Victor" },
  { id: "1665659611374-8e69a757ebf8", alt: "Low angle view of a tower, by Sergey Kvint" },
  { id: "1714659784722-1b8d820e2174", alt: "Orange wall with a black street light, by Artur Adilkhanian" },
];
const src = (index: number, width: number) =>
  `https://images.unsplash.com/photo-${photos[index].id}?auto=format&fit=crop&w=${width}&q=70`;

type Collection = { title: string; note: string; cover: number };
type Row = { title: string; note: string; value: string; thumb?: number };
type View = { title: string; meta: string } & (
  | { layout: "grid" }
  | { layout: "collections"; collections: Collection[] }
  | { layout: "rows"; rows: Row[] }
);

const views: Record<string, View> = {
  library: { layout: "grid", title: "Library", meta: "148 frames, last import today" },
  albums: {
    layout: "collections", title: "Albums", meta: "6 albums, 110 frames sorted",
    collections: [
      { title: "Yerevan in orange", note: "24 frames", cover: 0 },
      { title: "Zurich windows", note: "18 frames", cover: 1 },
      { title: "Berlin pastel", note: "31 frames", cover: 2 },
      { title: "Lines and sky", note: "12 frames", cover: 3 },
      { title: "Stripes", note: "9 frames", cover: 4 },
      { title: "Desert walls", note: "16 frames", cover: 5 },
    ],
  },
  import: {
    layout: "rows", title: "Import", meta: "4 files this week",
    rows: [
      { title: "DSCF4182.RAF", note: "Fujifilm X-E4, 26.4 MB", value: "Imported", thumb: 8 },
      { title: "DSCF4181.RAF", note: "Fujifilm X-E4, 25.9 MB", value: "Imported", thumb: 11 },
      { title: "DJI_0093.DNG", note: "Mini 3 Pro, 41.2 MB", value: "Processing", thumb: 10 },
      { title: "DSCF4177.RAF", note: "Fujifilm X-E4, 26.1 MB", value: "Duplicate skipped", thumb: 6 },
    ],
  },
  shared: {
    layout: "collections", title: "Shared", meta: "2 new since Monday",
    collections: [
      { title: "Facade studies", note: "From Mara Ilves, 14 frames", cover: 7 },
      { title: "Coast road trip", note: "From Dev Arora, 52 frames", cover: 9 },
      { title: "Print selects", note: "You and 3 others, 8 frames", cover: 6 },
    ],
  },
  you: {
    layout: "rows", title: "You", meta: "Studio plan, renews March 4",
    rows: [
      { title: "Storage", note: "Originals and edits", value: "38.2 of 50 GB" },
      { title: "Default export", note: "Used by Share and Download", value: "JPEG, 2400 px" },
      { title: "Camera profiles", note: "Applied on import", value: "2 active" },
      { title: "Backup", note: "Last run 6:40 this morning", value: "Up to date" },
    ],
  },
};

const demoStyles = `
.frames { font-family: "Manrope Variable", Manrope, system-ui, sans-serif; }
.frames ::selection { background: var(--color-primary); color: var(--color-primary-foreground); }
.frames-scroll { scrollbar-width: thin; scrollbar-color: var(--color-border) transparent; }
.frames-view { animation: frames-in .28s cubic-bezier(.16, 1, .3, 1); }
@keyframes frames-in { from { opacity: 0; translate: 0 6px; } }
@media (prefers-reduced-motion: reduce) { .frames-view { animation: none; } }
`;

const routeId = () => {
  const id = typeof location === "undefined" ? "" : location.hash.slice(1);
  return id in views ? id : "albums";
};

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

  useEffect(() => {
    const update = () => setActiveId(routeId());
    addEventListener("hashchange", update);
    addEventListener("popstate", update);
    return () => { removeEventListener("hashchange", update); removeEventListener("popstate", update); };
  }, []);

  const onNavigate = (item: DockItem, event: MouseEvent<HTMLAnchorElement>) => {
    event.preventDefault();
    if (location.hash !== item.href) history.pushState(null, "", item.href);
    setActiveId(item.id);
  };

  const view = views[activeId];
  return (
    <main className="frames grid h-svh min-h-[540px] w-full place-items-center bg-muted text-foreground sm:p-6">
      <style>{demoStyles}</style>
      {/* The app window keeps one composition at any preview size: photos always run under the dock. */}
      <div className="relative isolate h-full max-h-[720px] w-full max-w-[1000px] overflow-hidden bg-background sm:rounded-3xl sm:border sm:border-border">
      <div className="frames-scroll h-full overflow-y-auto">
        <div className="w-full px-4 pb-40 pt-5 sm:px-8 sm:pt-7">
          <div className="flex items-center justify-between gap-4">
            <span className="flex items-center gap-2 text-sm font-bold tracking-tight">
              <Aperture className="size-5" aria-hidden="true" /> Frames
            </span>
            <a className="text-xs text-muted-foreground underline-offset-4 hover:underline"
              href="https://unsplash.com" target="_blank" rel="noreferrer">Photos from Unsplash</a>
          </div>
          <div className="frames-view" key={activeId}>
            <h1 className="mt-6 text-3xl font-semibold tracking-tight sm:text-4xl">{view.title}</h1>
            <p className="mt-1 text-sm text-muted-foreground">{view.meta}</p>

            {view.layout === "grid" && (
              <ul className="mt-6 grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4">
                {photos.map((photo, index) => (
                  <li key={photo.id}>
                    <img className="aspect-[3/4] w-full rounded-xl bg-muted object-cover"
                      src={src(index, 500)} alt={photo.alt} loading={index < 8 ? "eager" : "lazy"} />
                  </li>
                ))}
              </ul>
            )}

            {view.layout === "collections" && (
              <ul className="mt-6 grid grid-cols-2 gap-x-3 gap-y-5 sm:grid-cols-3">
                {view.collections.map(collection => (
                  <li key={collection.title}>
                    <img className="aspect-[4/3] w-full rounded-2xl bg-muted object-cover"
                      src={src(collection.cover, 700)} alt={photos[collection.cover].alt} />
                    <p className="mt-2 text-sm font-semibold">{collection.title}</p>
                    <p className="text-xs text-muted-foreground">{collection.note}</p>
                  </li>
                ))}
              </ul>
            )}

            {view.layout === "rows" && (
              <ul className="mt-6 divide-y divide-border border-y border-border">
                {view.rows.map(row => (
                  <li key={row.title} className="flex items-center gap-3 py-3">
                    {row.thumb !== undefined && (
                      <img className="size-12 shrink-0 rounded-lg bg-muted object-cover" src={src(row.thumb, 160)} alt="" />
                    )}
                    <div className="min-w-0 flex-1">
                      <p className="truncate text-sm font-semibold">{row.title}</p>
                      <p className="truncate text-xs text-muted-foreground">{row.note}</p>
                    </div>
                    <span className="shrink-0 text-xs font-medium tabular-nums text-muted-foreground">{row.value}</span>
                  </li>
                ))}
              </ul>
            )}
          </div>
        </div>
      </div>

      <div className="pointer-events-none absolute inset-x-0 bottom-0 px-4 pb-[max(16px,env(safe-area-inset-bottom))]">
        <LiquidGlassNotchedDock
          items={destinations}
          activeId={activeId}
          onNavigate={onNavigate}
          label="Frames"
          notchDepth={s.notchDepth * 1.25}
          glass={{ blur: s.frost, opacity: s.tint, edge: s.edgeLight, distortion: s.refraction }}
        />
      </div>
      </div>
    </main>
  );
}

Dependencies

More by Automate Flows w/ Troy

View all
  • Adjustable Glass Dashboard

    Adjustable Glass Dashboard

    1.2K
  • Glass Dashboard

    Glass Dashboard

    1.1K
  • Interactive Workflow Blueprint

    Interactive Workflow Blueprint

    599
  • Glassy Coverflow Carousel

    Glassy Coverflow Carousel

    415
  • Liquid Glass Expandable Sidebar

    Liquid Glass Expandable Sidebar

    302
  • Liquid Glass Footer

    Liquid Glass Footer

    237
  • Dimensional Workflow Hero

    Dimensional Workflow Hero

    172
  • KNOCKOUT Landing Page

    KNOCKOUT Landing Page

    154

More in Navigation

View all
  • Footer with Big Wordmark

    Footer with Big Wordmark

    100
  • Sidebar

    Sidebar

    422
  • Pagination with Ellipsis

    Pagination with Ellipsis

    25
  • Pagination

    Pagination

    3
  • Tabs

    Tabs

    33
  • Menu

    Menu

    23
  • Breadrcrumb

    Breadrcrumb

    6
  • NavBar

    NavBar

    2