{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"holo-pill-nav","type":"registry:component","title":"Holo Pill Nav","description":"A quiet header: the mark and wordmark left, one outlined glass pill right that fills from below on hover while an asterisk turns in beside the label. A tone prop flips it for dark sections.","dependencies":[],"registryDependencies":[],"files":[{"path":"components/viberdy/holo-pill-nav.tsx","content":"\"use client\";\n\nimport { type CSSProperties } from \"react\";\n\n/* ============================================================================\n * SHARED PIECES\n * ========================================================================== */\n\n/** The kit's face. Urbanist is set at 300 for the quiet line, 700 for the loud one. */\nexport const HG_FONT = 'var(--font-urbanist, \"Urbanist\"), \"Outfit\", ui-sans-serif, system-ui, sans-serif';\n\n/** The kit's palette. Ground and ink do the work; the colour lives inside the glass. */\nexport const HG = {\n  ground: \"#eef0f5\",\n  paper: \"#f7f8fb\",\n  ink: \"#15161b\",\n  inkSoft: \"rgba(21,22,27,0.62)\",\n  inkMute: \"rgba(21,22,27,0.42)\",\n  line: \"rgba(21,22,27,0.10)\",\n  night: \"#0d0e11\",\n  cobalt: \"#2b46ff\",\n  violet: \"#7b5cff\",\n  pink: \"#ff6fb5\",\n  coral: \"#ff4a4a\",\n  orange: \"#ff8a1f\",\n} as const;\n\n/** The eight-spoke asterisk the kit uses as caret, bullet and spinner. */\nexport function HgAsterisk({ className, style, stroke = 1.6 }: { className?: string; style?: CSSProperties; stroke?: number }) {\n  return (\n    <svg viewBox=\"0 0 24 24\" aria-hidden className={className} style={style} fill=\"none\" stroke=\"currentColor\" strokeWidth={stroke} strokeLinecap=\"round\">\n      <path d=\"M12 3v18M3 12h18M5.6 5.6l12.8 12.8M18.4 5.6 5.6 18.4\" />\n    </svg>\n  );\n}\n\n/** viberdy's V, as a solid mark. */\nexport function HgVMark({ className, style }: { className?: string; style?: CSSProperties }) {\n  return (\n    <svg viewBox=\"0 0 32 32\" aria-hidden className={className} style={style}>\n      <rect width=\"32\" height=\"32\" rx=\"9\" fill=\"currentColor\" />\n      <path d=\"M9 10.5 L15.2 22.5 L16.8 22.5 L23 10.5 L19.6 10.5 L16 18.2 L12.4 10.5 Z\" fill=\"#fff\" />\n    </svg>\n  );\n}\n\n/* ============================================================================\n * NAV + ASTERISK HEADLINE\n * ========================================================================== */\n\nconst HG_NAV_CSS = `\n.hg-pill{position:relative;overflow:hidden;isolation:isolate;transition:color .45s cubic-bezier(.2,.7,.2,1),border-color .45s,background-color .45s}\n.hg-pill::before{content:\"\";position:absolute;inset:0;z-index:-1;border-radius:inherit;background:var(--hg-pill-fill);transform:translateY(102%);transition:transform .5s cubic-bezier(.2,.7,.2,1)}\n.hg-pill:hover::before,.hg-pill:focus-visible::before{transform:none}\n.hg-pill:hover,.hg-pill:focus-visible{color:var(--hg-pill-on)}\n.hg-pill .hg-pill-star{width:0;opacity:0;margin-left:0;transition:width .45s cubic-bezier(.2,.7,.2,1),opacity .3s,margin .45s}\n.hg-pill:hover .hg-pill-star,.hg-pill:focus-visible .hg-pill-star{width:.8em;opacity:1;margin-left:.45em;animation:hg-spin 2.4s linear infinite}\n.hg-pill:focus-visible{outline:2px solid var(--hg-ring) !important;outline-offset:3px}\n@keyframes hg-spin{to{transform:rotate(360deg)}}\n@media (prefers-reduced-motion: reduce){.hg-pill::before,.hg-pill .hg-pill-star{transition:none}.hg-pill:hover .hg-pill-star{animation:none}}\n`;\n\nexport type HgTone = \"light\" | \"dark\";\n\n/** Nav links come from props: keep only same-page, relative, http(s) and mailto targets. */\nfunction hgNavHref(href: string): string {\n  const h = href.trim();\n  if (h.includes(\"\\\\\")) return \"#\";\n  if (h.startsWith(\"#\") || (h.startsWith(\"/\") && !h.startsWith(\"//\"))) return h;\n  try {\n    const u = new URL(h);\n    return u.protocol === \"https:\" || u.protocol === \"http:\" || u.protocol === \"mailto:\" ? u.href : \"#\";\n  } catch {\n    return \"#\";\n  }\n}\n\n/**\n * The header: the mark and wordmark left, one outlined pill right. The pill\n * fills from below on hover and an asterisk turns in beside the label. `tone`\n * flips it for dark sections; the site drives it from what is underneath.\n */\nexport function HgNav({\n  brand = \"viberdy\",\n  cta = \"Pricing\",\n  href = \"#pricing\",\n  tone = \"light\",\n  links,\n  className,\n  style,\n}: {\n  brand?: string;\n  cta?: string;\n  href?: string;\n  tone?: HgTone;\n  links?: { label: string; href: string }[];\n  className?: string;\n  style?: CSSProperties;\n}) {\n  const dark = tone === \"dark\";\n  const ink = dark ? \"#f4f5f8\" : HG.ink;\n  return (\n    <header\n      className={\"flex items-center justify-between \" + (className ?? \"\")}\n      style={{ fontFamily: HG_FONT, color: ink, transition: \"color .45s\", ...style }}\n    >\n      <style>{HG_NAV_CSS}</style>\n      <a href=\"#top\" className=\"flex items-center gap-[0.55em] rounded-md text-[17px] font-semibold tracking-[-0.02em] outline-none focus-visible:ring-2\" style={{ color: \"inherit\" }}>\n        <HgVMark className=\"h-[1.3em] w-[1.3em]\" style={{ color: dark ? \"#f4f5f8\" : HG.cobalt, transition: \"color .45s\" }} />\n        {brand}\n      </a>\n      <nav className=\"flex items-center gap-7\" aria-label=\"Primary\">\n        {links?.map((l) => (\n          <a key={l.href + l.label} href={hgNavHref(l.href)} className=\"hidden text-[13px] font-medium opacity-70 transition-opacity hover:opacity-100 md:block\" style={{ color: \"inherit\" }}>\n            {l.label}\n          </a>\n        ))}\n        <a\n          href={hgNavHref(href)}\n          className=\"hg-pill inline-flex h-9 items-center rounded-full px-[18px] text-[13px] font-medium\"\n          style={\n            {\n              color: \"inherit\",\n              border: \"1px solid \" + (dark ? \"rgba(244,245,248,0.28)\" : \"rgba(21,22,27,0.14)\"),\n              background: dark ? \"rgba(255,255,255,0.05)\" : \"rgba(255,255,255,0.55)\",\n              backdropFilter: \"blur(10px)\",\n              WebkitBackdropFilter: \"blur(10px)\",\n              \"--hg-pill-fill\": dark ? \"#f4f5f8\" : HG.ink,\n              \"--hg-pill-on\": dark ? HG.ink : \"#fff\",\n              \"--hg-ring\": dark ? \"#f4f5f8\" : HG.cobalt,\n            } as CSSProperties\n          }\n        >\n          {cta}\n          <HgAsterisk className=\"hg-pill-star inline-block h-[0.8em]\" stroke={2.2} />\n        </a>\n      </nav>\n    </header>\n  );\n}\n","type":"registry:component","target":"components/viberdy/holo-pill-nav.tsx"}],"meta":{"tier":"free","tags":["navbar","header","pill button","glass","hover fill","dark mode","minimal"],"href":"https://viberdy.dev/library/holo-pill-nav","aiPrompt":"Build a React + Tailwind site header, `HgNav`, in one \"use client\" file with no dependencies. It is a flat, quiet header: a square mark and wordmark on the left, an optional row of text links, and one outlined pill button on the right. The pill fills from below on hover and an eight-spoke asterisk turns in beside its label. It works on a light or a dark section through a `tone` prop, and it ships with the small shared pieces the rest of a kit would reuse.\n\nShared pieces exported from the same file:\n- `HG_FONT`: `var(--font-urbanist, \"Urbanist\"), \"Outfit\", ui-sans-serif, system-ui, sans-serif`. The header sets itself in this stack.\n- `HG` palette: ground #eef0f5, paper #f7f8fb, ink #15161b, inkSoft rgba(21,22,27,0.62), inkMute rgba(21,22,27,0.42), line rgba(21,22,27,0.10), night #0d0e11, cobalt #2b46ff, violet #7b5cff, pink #ff6fb5, coral #ff4a4a, orange #ff8a1f.\n- `HgAsterisk`: an inline SVG on a 24 by 24 viewBox, fill none, `stroke=\"currentColor\"`, round caps, default stroke width 1.6, aria-hidden. Its single path draws four crossing lines through the centre: `M12 3v18M3 12h18M5.6 5.6l12.8 12.8M18.4 5.6 5.6 18.4`.\n- `HgVMark`: a 32 by 32 SVG, a rounded square (rx 9) filled with `currentColor` and a white V cut as a polygon: `M9 10.5 L15.2 22.5 L16.8 22.5 L23 10.5 L19.6 10.5 L16 18.2 L12.4 10.5 Z`.\n\nLayout. The root is a `<header>` with `flex items-center justify-between` plus any `className`, `font-family` HG_FONT, `color` ink, and `transition: color .45s` so a tone change fades. Left: an anchor to `#top`, `flex items-center gap-[0.55em]`, 17px, weight 600 (`font-semibold`), tracking -0.02em, rounded-md, outline none with a `focus-visible:ring-2`. Inside it the V mark at 1.3em by 1.3em, coloured cobalt on light and #f4f5f8 on dark (colour transition .45s), then the brand text. Right: a `<nav aria-label=\"Primary\">` with `flex items-center gap-7`. Each optional link is 13px, weight 500, opacity 0.7 rising to 1 on hover, and hidden below the `md` breakpoint (`hidden md:block`). Last in the nav is the pill anchor: `inline-flex h-9 items-center rounded-full px-[18px] text-[13px] font-medium`, 1px border (rgba(21,22,27,0.14) on light, rgba(244,245,248,0.28) on dark), background rgba(255,255,255,0.55) on light or rgba(255,255,255,0.05) on dark, and `backdrop-filter: blur(10px)` (with the -webkit prefix). The pill sets three CSS custom properties inline: `--hg-pill-fill` (ink on light, #f4f5f8 on dark), `--hg-pill-on` (white on light, ink on dark) and `--hg-ring` (cobalt on light, #f4f5f8 on dark). The label is followed by an `HgAsterisk` with class `hg-pill-star`, stroke 2.2, `inline-block`, height 0.8em.\n\nMotion, all in a `<style>` element rendered inside the header so the file is self-contained:\n- `.hg-pill` is `position:relative; overflow:hidden; isolation:isolate`, and transitions colour .45s, border-color .45s and background-color .45s on `cubic-bezier(.2,.7,.2,1)`.\n- `.hg-pill::before` is an absolutely positioned inset-0 layer at z-index -1 with `border-radius: inherit`, background `var(--hg-pill-fill)`, resting at `translateY(102%)` (hidden below the pill) and transitioning `transform .5s cubic-bezier(.2,.7,.2,1)`. On `:hover` and `:focus-visible` it goes to `transform: none`, so the fill rises from the bottom edge, and the text colour switches to `var(--hg-pill-on)` at the same time.\n- `.hg-pill-star` rests at `width:0; opacity:0; margin-left:0` and transitions width .45s (same easing), opacity .3s, margin .45s. On hover or focus it becomes `width:.8em; opacity:1; margin-left:.45em` and runs the `hg-spin` keyframes (`to{transform:rotate(360deg)}`) at 2.4s linear infinite. The label therefore slides left as the star opens.\n- Focus ring: `:focus-visible` gives `outline: 2px solid var(--hg-ring) !important` with 3px offset. Keyboard focus must look identical to hover plus the ring.\n\nReduced motion: under `prefers-reduced-motion: reduce` the fill and the star lose their transitions and the star stops spinning, so the states still change but instantly.\n\nAccessibility: the nav is labelled \"Primary\", the mark and asterisk are aria-hidden, the pill is a real anchor so it works without script, and contrast is carried by the ink and white pair.\n\nThere is no scroll or script logic inside the component. The host decides `tone` (for example from the section under the header) and the colour fades by transition.\n\nProps: `brand` (\"viberdy\"), `cta` (\"Pricing\"), `href` (\"#pricing\"), `tone` (\"light\" | \"dark\", default \"light\"), `links` (optional array of `{label, href}`, default none), `className`, `style` (merged last so the host can pin or position it).","license":"https://viberdy.dev/license"}}