Headers & navigation / Headers & nav bars
Frosted Transparent Header
Transparent overlay header with wordmark left, centered chevron dropdown links, and right-aligned text link, glass outlined pill and solid periwinkle pill. Inverts to dark text on the light release page.
Rebuilt from mercury.com in the Twilight Ledger style.
Looks exactly like mercury.com: brings its fonts and colours, namespaced so your own theme stays untouched.
Restyled to your project: uses your shadcn colours, fonts and radius, so it matches the rest of your app. Layout, type sizes and motion stay as designed.
Usage
Place at the top of a hero with a photo behind it; the header is absolutely positioned and transparent. Props: brand, items (label + optional menu), loginLabel, demoLabel, ctaLabel, and light to switch to dark text for light pages.
components/frosted-nav-bar.tsx
import { useState } from "react"; type NavItem = { label: string; menu?: string[] }; type Props = { brand?: string; items?: NavItem[]; loginLabel?: string; demoLabel?: string; ctaLabel?: string; light?: boolean; }; const defaultItems: NavItem[] = [ { label: "Business", menu: ["Checking", "Savings", "Cards"] }, { label: "Personal" }, { label: "Solutions", menu: ["Payments", "Treasury", "Invoicing"] }, { label: "Resources", menu: ["Guides", "Help center", "Changelog"] }, { label: "About", menu: ["Company", "Careers", "Press"] }, { label: "Pricing" }, ]; function Chevron() { return ( <svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true"> <path d="M3.5 6l4.5 4.5L12.5 6" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" strokeLinejoin="round" /> </svg> ); } function Mark() { return ( <svg width="32" height="32" viewBox="0 0 32 32" fill="none" aria-hidden="true"> <circle cx="16" cy="16" r="15" stroke="currentColor" strokeWidth="1.2" /> <circle cx="16" cy="10" r="4" stroke="currentColor" strokeWidth="1.2" /> <circle cx="16" cy="22" r="4" stroke="currentColor" strokeWidth="1.2" /> <circle cx="10" cy="16" r="4" stroke="currentColor" strokeWidth="1.2" /> <circle cx="22" cy="16" r="4" stroke="currentColor" strokeWidth="1.2" /> </svg> ); } export default function FrostedTransparentHeader({ brand = "HARBORLINE", items = defaultItems, loginLabel = "Sign in", demoLabel = "Book a tour", ctaLabel = "Get started", light = false, }: Props) { const [open, setOpen] = useState<number | null>(null); const text = light ? "text-ink-dark" : "text-ink"; const wash = "transition-colors duration-hover-wash ease-hover-wash hover:bg-[#9cb4e8]/30"; const focus = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent"; return ( <header className={`absolute inset-x-0 top-0 z-50 ${text} font-sans`}> <div className="mx-auto flex h-[72px] max-w-[1440px] items-center justify-between px-5 lg:px-8"> <a href="#" className={`flex items-center gap-3 rounded-md ${focus}`} aria-label={brand}> <Mark /> <span className="text-[16px] font-medium tracking-[0.2em]">{brand}</span> </a> <nav aria-label="Main" className="hidden items-center gap-1 lg:flex"> {items.map((it, i) => ( <div key={it.label} className="relative" onMouseLeave={() => setOpen(null)}> <button type="button" aria-haspopup={it.menu ? "menu" : undefined} aria-expanded={it.menu ? open === i : undefined} onClick={() => it.menu && setOpen(open === i ? null : i)} className={`group flex items-center gap-1.5 rounded-lg px-4 py-2 text-label ${wash} ${focus}`} > {it.label} {it.menu && <Chevron />} </button> {it.menu && open === i && ( <ul role="menu" className="absolute left-0 top-full mt-1 min-w-[180px] rounded-xl border border-hairline bg-surface/80 p-2 text-ink shadow-float backdrop-blur-[20px]"> {it.menu.map((m) => ( <li key={m} role="none"> <a role="menuitem" href="#" className={`block rounded-md px-3 py-2 text-label ${wash} ${focus}`}>{m}</a> </li> ))} </ul> )} </div> ))} </nav> <div className="flex items-center gap-2 text-label"> <a href="#" className={`hidden rounded-lg px-4 py-2 sm:block ${wash} ${focus}`}>{loginLabel}</a> <a href="#" className={`hidden rounded-pill border border-hairline bg-glass-fill px-4 py-2 backdrop-blur-[20px] ${wash} ${focus} md:block`}>{demoLabel}</a> <a href="#" className={`rounded-pill bg-accent px-4 py-2 text-white transition-opacity duration-hover-wash hover:opacity-90 ${focus}`}>{ctaLabel}</a> </div> </div> </header> ); }import { useState } from "react"; type NavItem = { label: string; menu?: string[] }; type Props = { brand?: string; items?: NavItem[]; loginLabel?: string; demoLabel?: string; ctaLabel?: string; light?: boolean; }; const defaultItems: NavItem[] = [ { label: "Business", menu: ["Checking", "Savings", "Cards"] }, { label: "Personal" }, { label: "Solutions", menu: ["Payments", "Treasury", "Invoicing"] }, { label: "Resources", menu: ["Guides", "Help center", "Changelog"] }, { label: "About", menu: ["Company", "Careers", "Press"] }, { label: "Pricing" }, ]; function Chevron() { return ( <svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true"> <path d="M3.5 6l4.5 4.5L12.5 6" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" strokeLinejoin="round" /> </svg> ); } function Mark() { return ( <svg width="32" height="32" viewBox="0 0 32 32" fill="none" aria-hidden="true"> <circle cx="16" cy="16" r="15" stroke="currentColor" strokeWidth="1.2" /> <circle cx="16" cy="10" r="4" stroke="currentColor" strokeWidth="1.2" /> <circle cx="16" cy="22" r="4" stroke="currentColor" strokeWidth="1.2" /> <circle cx="10" cy="16" r="4" stroke="currentColor" strokeWidth="1.2" /> <circle cx="22" cy="16" r="4" stroke="currentColor" strokeWidth="1.2" /> </svg> ); } export default function FrostedTransparentHeader({ brand = "HARBORLINE", items = defaultItems, loginLabel = "Sign in", demoLabel = "Book a tour", ctaLabel = "Get started", light = false, }: Props) { const [open, setOpen] = useState<number | null>(null); const text = light ? "text-muted-foreground" : "text-foreground"; const wash = "transition-colors duration-twilight-hover-wash ease-twilight-hover-wash hover:bg-[#9cb4e8]/30"; const focus = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"; return ( <header className={`absolute inset-x-0 top-0 z-50 ${text} font-sans`}> <div className="mx-auto flex h-[72px] max-w-[1440px] items-center justify-between px-5 lg:px-8"> <a href="#" className={`flex items-center gap-3 rounded-lg ${focus}`} aria-label={brand}> <Mark /> <span className="text-[16px] font-medium tracking-[0.2em]">{brand}</span> </a> <nav aria-label="Main" className="hidden items-center gap-1 lg:flex"> {items.map((it, i) => ( <div key={it.label} className="relative" onMouseLeave={() => setOpen(null)}> <button type="button" aria-haspopup={it.menu ? "menu" : undefined} aria-expanded={it.menu ? open === i : undefined} onClick={() => it.menu && setOpen(open === i ? null : i)} className={`group flex items-center gap-1.5 rounded-2xl px-4 py-2 text-twilight-label ${wash} ${focus}`} > {it.label} {it.menu && <Chevron />} </button> {it.menu && open === i && ( <ul role="menu" className="absolute left-0 top-full mt-1 min-w-[180px] rounded-2xl border border-border bg-card/80 p-2 text-foreground shadow-twilight-float backdrop-blur-[20px]"> {it.menu.map((m) => ( <li key={m} role="none"> <a role="menuitem" href="#" className={`block rounded-lg px-3 py-2 text-twilight-label ${wash} ${focus}`}>{m}</a> </li> ))} </ul> )} </div> ))} </nav> <div className="flex items-center gap-2 text-twilight-label"> <a href="#" className={`hidden rounded-2xl px-4 py-2 sm:block ${wash} ${focus}`}>{loginLabel}</a> <a href="#" className={`hidden rounded-full border border-border bg-secondary px-4 py-2 backdrop-blur-[20px] ${wash} ${focus} md:block`}>{demoLabel}</a> <a href="#" className={`rounded-full bg-primary px-4 py-2 text-primary-foreground transition-opacity duration-twilight-hover-wash hover:opacity-90 ${focus}`}>{ctaLabel}</a> </div> </div> </header> ); }
Quality checks
Automated, in a real browser · 4d ago- Accessible: passedNo serious accessibility problems (axe-core): readable contrast, labelled buttons and images.
- Responsive: passedRenders at phone (390px), tablet (768px) and desktop width without sideways scrolling.
- Dark mode: passedStill readable when installed in your theme and switched to dark mode.
- Themeable: not passed1 hard-coded colour (bg-[#9cb4e8]/30). These ignore the theme and break dark mode.
- Animates cleanly: doesn't applyDoesn't animate, so there's nothing to check.