About
A vertical liquid glass rail with two signals: a marker on the current page and a light that follows the pointer or keyboard focus, brightening icons and carrying their label. Tune frost, tint, refraction and beam strength.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Liquid Glass Spotlight Navigation to your project and fits it to your theme.
Code
How Liquid Glass Spotlight Navigation 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 { Activity, BellRing, Gauge, Server, Settings2, Waypoints } from "lucide-react";
import "@fontsource-variable/manrope";
import LiquidGlassSpotlightNavigation, {
type SpotlightItem,
} from "@/components/ui/liquid-glass-spotlight-navigation";
const settings = {
beamStrength: 0.8,
frost: 5,
tint: 0.72,
refraction: 18,
edgeLight: 1,
followPointer: true,
};
const destinations: SpotlightItem[] = [
{ id: "overview", href: "#overview", label: "Overview", icon: <Gauge /> },
{ id: "services", href: "#services", label: "Services", icon: <Server /> },
{ id: "incidents", href: "#incidents", label: "Incidents", icon: <Activity />, badge: "2 open incidents" },
{ id: "traces", href: "#traces", label: "Traces", icon: <Waypoints /> },
{ id: "alerts", href: "#alerts", label: "Alert rules", icon: <BellRing /> },
];
const secondary: SpotlightItem[] = [
{ id: "settings", href: "#settings", label: "Settings", icon: <Settings2 /> },
];
// Demo content only: a small on-call console with one table per destination.
type State = "ok" | "warn" | "down";
type Row = { name: string; note: string; value: string; state: State };
const views: Record<string, { title: string; meta: string; rows: Row[] }> = {
overview: {
title: "Overview", meta: "All regions, last 60 minutes",
rows: [
{ name: "Edge gateway", note: "fra1, iad1, sin1", value: "42 ms", state: "ok" },
{ name: "Checkout API", note: "iad1", value: "318 ms", state: "warn" },
{ name: "Search index", note: "fra1", value: "88 ms", state: "ok" },
{ name: "Media workers", note: "sin1", value: "Queue 1.2k", state: "down" },
{ name: "Auth", note: "fra1, iad1", value: "27 ms", state: "ok" },
],
},
services: {
title: "Services", meta: "14 services, 3 regions",
rows: [
{ name: "edge-gateway", note: "v4.18.2, 24 pods", value: "99.99%", state: "ok" },
{ name: "checkout-api", note: "v2.7.0, 12 pods", value: "99.71%", state: "warn" },
{ name: "search-index", note: "v9.1.4, 6 pods", value: "99.98%", state: "ok" },
{ name: "media-workers", note: "v1.33.0, 18 pods", value: "97.20%", state: "down" },
{ name: "auth", note: "v5.2.1, 8 pods", value: "100%", state: "ok" },
],
},
incidents: {
title: "Incidents", meta: "2 open, 1 resolved today",
rows: [
{ name: "Media queue backlog in sin1", note: "Opened 21:04, Priya on call", value: "Sev 2", state: "down" },
{ name: "Checkout p95 above 300 ms", note: "Opened 21:37, unassigned", value: "Sev 3", state: "warn" },
{ name: "Expired TLS certificate on status page", note: "Resolved 14:12", value: "Closed", state: "ok" },
],
},
traces: {
title: "Traces", meta: "Slowest requests, last 15 minutes",
rows: [
{ name: "POST /checkout/confirm", note: "checkout-api to payments", value: "1.84 s", state: "down" },
{ name: "GET /search?q=", note: "edge-gateway to search-index", value: "612 ms", state: "warn" },
{ name: "POST /media/transcode", note: "media-workers", value: "540 ms", state: "warn" },
{ name: "GET /session", note: "auth", value: "31 ms", state: "ok" },
],
},
alerts: {
title: "Alert rules", meta: "9 rules, 2 firing",
rows: [
{ name: "Queue depth above 1,000", note: "media-workers, 5 min window", value: "Firing", state: "down" },
{ name: "p95 latency above 300 ms", note: "checkout-api, 10 min window", value: "Firing", state: "warn" },
{ name: "Error rate above 1%", note: "All services", value: "Quiet", state: "ok" },
{ name: "Certificate expires in 14 days", note: "All domains", value: "Quiet", state: "ok" },
],
},
settings: {
title: "Settings", meta: "Workspace: AutomateFlows platform",
rows: [
{ name: "On-call rotation", note: "Weekly, hands over Monday 09:00", value: "4 people", state: "ok" },
{ name: "Paging", note: "Push first, phone call after 5 minutes", value: "Enabled", state: "ok" },
{ name: "Data retention", note: "Traces and logs", value: "30 days", state: "ok" },
],
},
};
const stateLabel: Record<State, string> = { ok: "Healthy", warn: "Degraded", down: "Failing" };
const stateDot: Record<State, string> = { ok: "bg-chart-2", warn: "bg-chart-1", down: "bg-destructive" };
// One hour of request latency, drawn in code. It runs full bleed so it passes under the rail.
const latency = [38, 41, 37, 44, 40, 52, 47, 43, 58, 71, 64, 59, 83, 96, 78, 72, 88, 104, 92, 81, 76, 69, 74, 66, 61, 57, 63, 55, 49, 46];
const errors = [12, 10, 14, 11, 13, 15, 12, 18, 22, 19, 24, 31, 28, 35, 41, 37, 33, 44, 39, 30, 27, 25, 21, 23, 18, 16, 19, 15, 13, 12];
const area = (series: number[]) =>
`M0 120 ${series.map((value, i) => `L${(i / (series.length - 1) * 1000).toFixed(1)} ${(120 - value).toFixed(1)}`).join(" ")} L1000 120Z`;
const demoStyles = `
.console { font-family: "Manrope Variable", Manrope, system-ui, sans-serif; }
.console ::selection { background: var(--color-primary); color: var(--color-primary-foreground); }
.console-scroll { scrollbar-width: thin; scrollbar-color: var(--color-border) transparent; }
.console-view { animation: console-in .28s cubic-bezier(.16, 1, .3, 1); }
@keyframes console-in { from { opacity: 0; translate: 0 6px; } }
@media (prefers-reduced-motion: reduce) { .console-view { animation: none; } }
`;
const routeId = () => {
const id = typeof location === "undefined" ? "" : location.hash.slice(1);
return id in views ? id : "incidents";
};
export default function LiquidGlassSpotlightNavigationDemo(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: SpotlightItem, 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="console grid h-svh min-h-[540px] w-full place-items-center bg-muted text-foreground sm:p-6">
<style>{demoStyles}</style>
{/* The console window keeps one composition at any preview size. */}
<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="console-scroll h-full overflow-y-auto">
<svg className="absolute inset-x-0 top-0 -z-10 h-60 w-full" viewBox="0 0 1000 120" preserveAspectRatio="none" aria-hidden="true">
<defs>
<linearGradient id="console-fade" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stopColor="white" stopOpacity=".9" />
<stop offset="1" stopColor="white" stopOpacity="0" />
</linearGradient>
<mask id="console-mask"><rect width="1000" height="120" fill="url(#console-fade)" /></mask>
</defs>
<g mask="url(#console-mask)">
<path d={area(latency)} className="fill-chart-1" />
<path d={area(errors)} className="fill-chart-2" />
</g>
</svg>
<div className="console-view min-h-full pb-10 pl-24 pr-4 pt-6 sm:pl-28 sm:pr-8 sm:pt-8" key={activeId}>
<p className="flex items-center gap-2 text-xs font-medium text-muted-foreground">
<span className="size-2 rounded-full bg-chart-2" aria-hidden="true" /> AutomateFlows platform, live
</p>
<h1 className="mt-2 text-3xl font-semibold tracking-tight sm:text-4xl">{view.title}</h1>
<p className="mt-1 text-sm text-muted-foreground">{view.meta}</p>
<ul className="mt-24 divide-y divide-border border-y border-border sm:mt-28">
{view.rows.map(row => (
<li key={row.name} className="flex items-center gap-3 py-3">
<span className={`size-2 shrink-0 rounded-full ${stateDot[row.state]}`} aria-hidden="true" />
<div className="min-w-0 flex-1">
<p className="truncate text-sm font-semibold">{row.name}</p>
<p className="truncate text-xs text-muted-foreground">{row.note}</p>
</div>
<span className="shrink-0 text-right text-sm font-medium tabular-nums">
{row.value}
<span className="block text-xs font-normal text-muted-foreground">{stateLabel[row.state]}</span>
</span>
</li>
))}
</ul>
</div>
</div>
<LiquidGlassSpotlightNavigation
className="!absolute inset-y-3 left-3 sm:inset-y-4 sm:left-4"
items={destinations}
secondaryItems={secondary}
activeId={activeId}
onNavigate={onNavigate}
label="Console"
beamStrength={s.beamStrength * 1.25}
followPointer={s.followPointer}
glass={{ blur: s.frost, opacity: s.tint, edge: s.edgeLight, distortion: s.refraction }}
/>
</div>
</main>
);
}















