{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "navbar-floating-capsule",
  "type": "registry:component",
  "title": "Navbar Floating Capsule",
  "description": "Three floating capsules for the brand, the links and the actions that glide together into one pill once the page scrolls. On small screens the pill itself grows into the menu, with staggered links and two full-width buttons.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "navigation",
    "navbar",
    "floating",
    "pill",
    "scroll",
    "mobile menu",
    "header"
  ],
  "docs": "https://hyperblur.dev/effects/navbar-floating-capsule",
  "files": [
    {
      "path": "registry/hyperblur/navbar-floating-capsule.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/navbar-floating-capsule.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface NavbarFloatingCapsuleLink {\n  label: string;\n  href: string;\n}\n\nexport interface NavbarFloatingCapsuleProps extends Omit<React.HTMLAttributes<HTMLElement>, \"children\"> {\n  brand?: string;\n  links?: NavbarFloatingCapsuleLink[];\n  active?: number;\n  defaultActive?: number;\n  onActiveChange?: (index: number) => void;\n  signIn?: { label: string; href: string } | null;\n  cta?: { label: string; href: string } | null;\n  merged?: boolean;\n  mergeOnScroll?: boolean;\n  threshold?: number;\n  menuOpen?: boolean;\n  defaultMenuOpen?: boolean;\n  onMenuOpenChange?: (open: boolean) => void;\n  accent?: string;\n  showBackdrop?: boolean;\n}\n\nconst defaultLinks: NavbarFloatingCapsuleLink[] = [\n  { label: \"Product\", href: \"#product\" },\n  { label: \"Changelog\", href: \"#changelog\" },\n  { label: \"Customers\", href: \"#customers\" },\n  { label: \"Pricing\", href: \"#pricing\" },\n  { label: \"Docs\", href: \"#docs\" },\n];\n\nconst ease = \"cubic-bezier(.22,1,.36,1)\";\n\nconst css = `\n.hb-xj1 {\n  --hb-xj1-accent: #f59e0b;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  container-type: inline-size;\n  padding: 18px 18px;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-xj1 *, .hb-xj1 *::before, .hb-xj1 *::after { box-sizing: border-box; }\n.hb-xj1[data-backdrop=\"true\"] { min-height: 620px; overflow: hidden; background: #0a0a0a; }\n.hb-xj1-bar {\n  position: relative;\n  z-index: 3;\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 14px;\n  width: 100%;\n  max-width: 1180px;\n  margin: 0 auto;\n  transition: max-width .7s ${ease}, gap .7s ${ease};\n}\n.hb-xj1[data-merged=\"true\"] .hb-xj1-bar { max-width: 880px; gap: 0; }\n.hb-xj1-shell {\n  position: absolute;\n  inset: 0;\n  border-radius: 999px;\n  border: 1px solid rgba(255,255,255,.1);\n  background: linear-gradient(180deg, rgba(30,30,32,.86), rgba(17,17,19,.9));\n  backdrop-filter: blur(18px) saturate(160%);\n  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 24px 60px -24px rgba(0,0,0,.9), 0 0 0 6px rgba(255,255,255,.02);\n  opacity: 0;\n  transform: scaleX(.94);\n  transition: opacity .5s ease, transform .7s ${ease};\n  pointer-events: none;\n}\n.hb-xj1[data-merged=\"true\"] .hb-xj1-shell { opacity: 1; transform: none; }\n.hb-xj1-cap {\n  position: relative;\n  display: flex;\n  align-items: center;\n  gap: 4px;\n  height: 52px;\n  padding: 0 6px;\n  border-radius: 999px;\n  border: 1px solid rgba(255,255,255,.09);\n  background: linear-gradient(180deg, rgba(28,28,30,.82), rgba(16,16,18,.86));\n  backdrop-filter: blur(14px) saturate(150%);\n  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 16px 40px -20px rgba(0,0,0,.9);\n  transition: border-color .5s ease, background-color .5s ease, box-shadow .5s ease, padding .7s ${ease};\n}\n.hb-xj1[data-merged=\"true\"] .hb-xj1-cap { border-color: transparent; background: transparent; box-shadow: none; backdrop-filter: none; }\n.hb-xj1-brand {\n  display: inline-flex;\n  align-items: center;\n  gap: 10px;\n  height: 40px;\n  padding: 0 14px 0 8px;\n  border-radius: 999px;\n  color: #ededed;\n  font-size: 15px;\n  font-weight: 650;\n  letter-spacing: -.02em;\n  text-decoration: none;\n}\n.hb-xj1-mark { position: relative; width: 26px; height: 26px; flex: none; }\n.hb-xj1-mark span {\n  position: absolute;\n  inset: 0;\n  border-radius: 9px;\n  background: linear-gradient(140deg, var(--hb-xj1-accent), #fb7185);\n  box-shadow: inset 0 1px 0 rgba(255,255,255,.4);\n}\n.hb-xj1-mark span + span { inset: 7px; border-radius: 4px; background: #141416; box-shadow: none; }\n.hb-xj1-links { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; }\n.hb-xj1-link {\n  position: relative;\n  display: inline-flex;\n  align-items: center;\n  height: 38px;\n  padding: 0 14px;\n  border-radius: 999px;\n  color: #9a9a9a;\n  font-size: 14px;\n  font-weight: 500;\n  white-space: nowrap;\n  text-decoration: none;\n  transition: color .2s ease, background-color .25s ease;\n}\n.hb-xj1-link:hover { color: #ededed; background: rgba(255,255,255,.05); }\n.hb-xj1-link[aria-current=\"page\"] { color: #ededed; }\n.hb-xj1-link[aria-current=\"page\"]::after {\n  content: \"\";\n  position: absolute;\n  left: 50%;\n  bottom: 4px;\n  width: 4px;\n  height: 4px;\n  border-radius: 50%;\n  background: var(--hb-xj1-accent);\n  box-shadow: 0 0 10px 2px color-mix(in srgb, var(--hb-xj1-accent) 60%, transparent);\n  transform: translateX(-50%);\n  animation: hb-xj1-dot .5s ${ease};\n}\n@keyframes hb-xj1-dot { from { transform: translateX(-50%) scale(0); } }\n.hb-xj1-sep {\n  width: 1px;\n  height: 20px;\n  margin: 0 4px;\n  background: rgba(255,255,255,.1);\n  opacity: 0;\n  transition: opacity .5s ease;\n}\n.hb-xj1[data-merged=\"true\"] .hb-xj1-sep { opacity: 1; }\n.hb-xj1-ghost {\n  display: inline-flex;\n  align-items: center;\n  height: 38px;\n  padding: 0 14px;\n  border-radius: 999px;\n  color: #c9c9c9;\n  font-size: 14px;\n  font-weight: 500;\n  text-decoration: none;\n  transition: color .2s ease, background-color .2s ease;\n}\n.hb-xj1-ghost:hover { color: #fff; background: rgba(255,255,255,.05); }\n.hb-xj1-cta {\n  position: relative;\n  display: inline-flex;\n  align-items: center;\n  gap: 8px;\n  height: 40px;\n  padding: 0 8px 0 16px;\n  border-radius: 999px;\n  background: linear-gradient(180deg, #ffffff, #e4e4e4);\n  color: #0a0a0a;\n  font-size: 14px;\n  font-weight: 600;\n  text-decoration: none;\n  white-space: nowrap;\n  box-shadow: inset 0 -1px 0 rgba(0,0,0,.12), 0 6px 18px -6px rgba(255,255,255,.35);\n  transition: transform .25s ${ease}, box-shadow .25s ease;\n}\n.hb-xj1-cta:hover { transform: translateY(-1px); box-shadow: inset 0 -1px 0 rgba(0,0,0,.12), 0 10px 24px -8px rgba(255,255,255,.45); }\n.hb-xj1-cta:active { transform: translateY(0) scale(.98); }\n.hb-xj1-cta i {\n  display: grid;\n  place-items: center;\n  width: 26px;\n  height: 26px;\n  border-radius: 50%;\n  background: #0a0a0a;\n  color: #fff;\n  font-style: normal;\n  transition: transform .3s ${ease};\n}\n.hb-xj1-cta:hover i { transform: translateX(2px) rotate(-45deg); }\n.hb-xj1-cta svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }\n.hb-xj1 a:focus-visible, .hb-xj1 button:focus-visible { outline: 2px solid var(--hb-xj1-accent); outline-offset: 2px; }\n.hb-xj1-mobile { display: none; }\n.hb-xj1-sheet { display: none; }\n@container (max-width: 900px) {\n  .hb-xj1-bar, .hb-xj1[data-merged=\"true\"] .hb-xj1-bar { display: none; }\n  .hb-xj1-mobile { position: relative; z-index: 4; display: block; max-width: 520px; margin: 0 auto; }\n  .hb-xj1-pill {\n    position: relative;\n    border-radius: 28px;\n    border: 1px solid rgba(255,255,255,.1);\n    background: linear-gradient(180deg, rgba(30,30,32,.92), rgba(17,17,19,.94));\n    backdrop-filter: blur(18px) saturate(160%);\n    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 24px 60px -24px rgba(0,0,0,.9);\n    overflow: hidden;\n    transition: border-radius .6s ${ease}, box-shadow .4s ease;\n  }\n  .hb-xj1[data-open=\"true\"] .hb-xj1-pill { border-radius: 24px; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 40px 80px -30px rgba(0,0,0,.95), 0 0 0 1px rgba(255,255,255,.04); }\n  .hb-xj1-mrow { display: flex; align-items: center; justify-content: space-between; height: 54px; padding: 0 7px 0 4px; }\n  .hb-xj1-toggle {\n    display: inline-flex;\n    align-items: center;\n    gap: 10px;\n    height: 40px;\n    padding: 0 14px 0 16px;\n    border: 0;\n    border-radius: 999px;\n    background: rgba(255,255,255,.07);\n    color: #ededed;\n    font: inherit;\n    font-size: 14px;\n    font-weight: 550;\n    cursor: pointer;\n    transition: background-color .2s ease;\n  }\n  .hb-xj1-toggle:hover { background: rgba(255,255,255,.11); }\n  .hb-xj1-burger { position: relative; width: 14px; height: 10px; }\n  .hb-xj1-burger span {\n    position: absolute;\n    left: 0;\n    width: 14px;\n    height: 1.6px;\n    border-radius: 2px;\n    background: currentColor;\n    transition: transform .45s ${ease}, top .45s ${ease};\n  }\n  .hb-xj1-burger span:first-child { top: 1px; }\n  .hb-xj1-burger span:last-child { top: 7px; }\n  .hb-xj1[data-open=\"true\"] .hb-xj1-burger span:first-child { top: 4px; transform: rotate(45deg); }\n  .hb-xj1[data-open=\"true\"] .hb-xj1-burger span:last-child { top: 4px; transform: rotate(-45deg); }\n  .hb-xj1-sheet { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .6s ${ease}; }\n  .hb-xj1[data-open=\"true\"] .hb-xj1-sheet { grid-template-rows: 1fr; }\n  .hb-xj1-sheet > div { min-height: 0; overflow: hidden; }\n  .hb-xj1-mlist { margin: 0; padding: 6px 10px 4px; list-style: none; border-top: 1px solid rgba(255,255,255,.06); }\n  .hb-xj1-mlist li {\n    opacity: 0;\n    transform: translateY(-6px);\n    transition: opacity .35s ease, transform .5s ${ease};\n    transition-delay: calc(var(--hb-xj1-i) * 40ms);\n  }\n  .hb-xj1[data-open=\"true\"] .hb-xj1-mlist li { opacity: 1; transform: none; }\n  .hb-xj1-mlink {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    height: 48px;\n    padding: 0 10px;\n    border-radius: 14px;\n    color: #d4d4d4;\n    font-size: 16px;\n    font-weight: 500;\n    letter-spacing: -.01em;\n    text-decoration: none;\n    transition: background-color .2s ease, color .2s ease;\n  }\n  .hb-xj1-mlink:hover { background: rgba(255,255,255,.05); color: #fff; }\n  .hb-xj1-mlink[aria-current=\"page\"] { color: #fff; }\n  .hb-xj1-mlink small { color: #6b6b6b; font-size: 12px; font-variant-numeric: tabular-nums; }\n  .hb-xj1-mlink[aria-current=\"page\"] small { color: var(--hb-xj1-accent); }\n  .hb-xj1-mfoot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 12px 14px; }\n  .hb-xj1-mfoot a { justify-content: center; height: 44px; }\n  .hb-xj1-mfoot .hb-xj1-ghost { border: 1px solid rgba(255,255,255,.1); }\n}\n.hb-xj1-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }\n.hb-xj1-glow {\n  position: absolute;\n  left: 50%;\n  top: -180px;\n  width: 900px;\n  height: 520px;\n  border-radius: 50%;\n  background: radial-gradient(closest-side, color-mix(in srgb, var(--hb-xj1-accent) 26%, transparent), transparent 70%);\n  transform: translateX(-50%);\n  filter: blur(10px);\n}\n.hb-xj1-grid {\n  position: absolute;\n  inset: 0;\n  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);\n  background-size: 56px 56px;\n  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 70%);\n  mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 70%);\n}\n.hb-xj1-hero { position: relative; z-index: 1; max-width: 760px; margin: 120px auto 0; padding: 0 20px; text-align: center; }\n.hb-xj1-eyebrow {\n  display: inline-flex;\n  align-items: center;\n  gap: 8px;\n  height: 30px;\n  padding: 0 12px;\n  border: 1px solid rgba(255,255,255,.1);\n  border-radius: 999px;\n  background: rgba(255,255,255,.03);\n  color: #bdbdbd;\n  font-size: 13px;\n}\n.hb-xj1-eyebrow b { color: var(--hb-xj1-accent); font-weight: 600; }\n.hb-xj1-hero h2 { margin: 22px 0 0; font-size: clamp(34px, 7cqi, 64px); font-weight: 650; line-height: 1.02; letter-spacing: -.045em; }\n.hb-xj1-hero p { max-width: 520px; margin: 18px auto 0; color: #8f8f8f; font-size: 17px; line-height: 1.55; }\n@media (prefers-reduced-motion: reduce) {\n  .hb-xj1 *, .hb-xj1 *::before, .hb-xj1 *::after { transition: none !important; animation: none !important; }\n}\n`;\n\nfunction Arrow() {\n  return (\n    <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n      <path d=\"M4 8h8M8.5 4.5 12 8l-3.5 3.5\" />\n    </svg>\n  );\n}\n\nexport function NavbarFloatingCapsule({\n  brand = \"Halftone\",\n  links = defaultLinks,\n  active,\n  defaultActive = 0,\n  onActiveChange,\n  signIn = { label: \"Sign in\", href: \"#signin\" },\n  cta = { label: \"Get started\", href: \"#start\" },\n  merged,\n  mergeOnScroll = true,\n  threshold = 40,\n  menuOpen,\n  defaultMenuOpen = false,\n  onMenuOpenChange,\n  accent = \"#f59e0b\",\n  showBackdrop = true,\n  className,\n  style,\n  ...rest\n}: NavbarFloatingCapsuleProps) {\n  const [innerActive, setInnerActive] = React.useState(defaultActive);\n  const [innerOpen, setInnerOpen] = React.useState(defaultMenuOpen);\n  const [scrolled, setScrolled] = React.useState(false);\n  const toggleRef = React.useRef<HTMLButtonElement>(null);\n  const sheetId = React.useId();\n  const current = active ?? innerActive;\n  const open = menuOpen ?? innerOpen;\n  const isMerged = merged ?? (mergeOnScroll && scrolled);\n\n  React.useEffect(() => {\n    if (merged !== undefined || !mergeOnScroll) return;\n    const onScroll = () => setScrolled(window.scrollY > threshold);\n    const raf = requestAnimationFrame(onScroll);\n    window.addEventListener(\"scroll\", onScroll, { passive: true });\n    return () => {\n      cancelAnimationFrame(raf);\n      window.removeEventListener(\"scroll\", onScroll);\n    };\n  }, [merged, mergeOnScroll, threshold]);\n\n  const setOpen = React.useCallback(\n    (next: boolean) => {\n      if (menuOpen === undefined) setInnerOpen(next);\n      onMenuOpenChange?.(next);\n    },\n    [menuOpen, onMenuOpenChange],\n  );\n\n  React.useEffect(() => {\n    if (!open) return;\n    const onKey = (e: KeyboardEvent) => {\n      if (e.key === \"Escape\") {\n        setOpen(false);\n        toggleRef.current?.focus();\n      }\n    };\n    document.addEventListener(\"keydown\", onKey);\n    return () => document.removeEventListener(\"keydown\", onKey);\n  }, [open, setOpen]);\n\n  const choose = (i: number) => {\n    if (active === undefined) setInnerActive(i);\n    onActiveChange?.(i);\n  };\n\n  const linkList = links.map((l, i) => (\n    <li key={l.href + i}>\n      <a className=\"hb-xj1-link\" href={l.href} aria-current={i === current ? \"page\" : undefined} onClick={() => choose(i)}>\n        {l.label}\n      </a>\n    </li>\n  ));\n\n  return (\n    <header\n      className={[\"hb-xj1\", className].filter(Boolean).join(\" \")}\n      data-merged={isMerged ? \"true\" : \"false\"}\n      data-open={open ? \"true\" : \"false\"}\n      data-backdrop={showBackdrop ? \"true\" : \"false\"}\n      style={{ \"--hb-xj1-accent\": accent, ...style } as React.CSSProperties}\n      {...rest}\n    >\n      <style href=\"hb-navbar-floating-capsule\" precedence=\"default\">\n        {css}\n      </style>\n      {showBackdrop && (\n        <div className=\"hb-xj1-bg\" aria-hidden=\"true\">\n          <div className=\"hb-xj1-glow\" />\n          <div className=\"hb-xj1-grid\" />\n        </div>\n      )}\n      <nav className=\"hb-xj1-bar\" aria-label=\"Main\">\n        <div className=\"hb-xj1-shell\" aria-hidden=\"true\" />\n        <div className=\"hb-xj1-cap\">\n          <a className=\"hb-xj1-brand\" href=\"#top\">\n            <span className=\"hb-xj1-mark\" aria-hidden=\"true\">\n              <span />\n              <span />\n            </span>\n            {brand}\n          </a>\n        </div>\n        <div className=\"hb-xj1-sep\" aria-hidden=\"true\" />\n        <div className=\"hb-xj1-cap\">\n          <ul className=\"hb-xj1-links\">{linkList}</ul>\n        </div>\n        <div className=\"hb-xj1-sep\" aria-hidden=\"true\" />\n        <div className=\"hb-xj1-cap\">\n          {signIn && (\n            <a className=\"hb-xj1-ghost\" href={signIn.href}>\n              {signIn.label}\n            </a>\n          )}\n          {cta && (\n            <a className=\"hb-xj1-cta\" href={cta.href}>\n              {cta.label}\n              <i>\n                <Arrow />\n              </i>\n            </a>\n          )}\n        </div>\n      </nav>\n      <nav className=\"hb-xj1-mobile\" aria-label=\"Main\">\n        <div className=\"hb-xj1-pill\">\n          <div className=\"hb-xj1-mrow\">\n            <a className=\"hb-xj1-brand\" href=\"#top\">\n              <span className=\"hb-xj1-mark\" aria-hidden=\"true\">\n                <span />\n                <span />\n              </span>\n              {brand}\n            </a>\n            <button\n              ref={toggleRef}\n              type=\"button\"\n              className=\"hb-xj1-toggle\"\n              aria-expanded={open}\n              aria-controls={sheetId}\n              onClick={() => setOpen(!open)}\n            >\n              {open ? \"Close\" : \"Menu\"}\n              <span className=\"hb-xj1-burger\" aria-hidden=\"true\">\n                <span />\n                <span />\n              </span>\n            </button>\n          </div>\n          <div className=\"hb-xj1-sheet\" id={sheetId} inert={!open}>\n            <div>\n              <ul className=\"hb-xj1-mlist\">\n                {links.map((l, i) => (\n                  <li key={l.href + i} style={{ \"--hb-xj1-i\": i } as React.CSSProperties}>\n                    <a\n                      className=\"hb-xj1-mlink\"\n                      href={l.href}\n                      aria-current={i === current ? \"page\" : undefined}\n                      onClick={() => {\n                        choose(i);\n                        setOpen(false);\n                      }}\n                    >\n                      {l.label}\n                      <small>{String(i + 1).padStart(2, \"0\")}</small>\n                    </a>\n                  </li>\n                ))}\n              </ul>\n              {(signIn || cta) && (\n                <div className=\"hb-xj1-mfoot\">\n                  {signIn && (\n                    <a className=\"hb-xj1-ghost\" href={signIn.href}>\n                      {signIn.label}\n                    </a>\n                  )}\n                  {cta && (\n                    <a className=\"hb-xj1-cta\" href={cta.href}>\n                      {cta.label}\n                    </a>\n                  )}\n                </div>\n              )}\n            </div>\n          </div>\n        </div>\n      </nav>\n      {showBackdrop && (\n        <div className=\"hb-xj1-hero\" aria-hidden=\"true\">\n          <span className=\"hb-xj1-eyebrow\">\n            <b>New</b> Print-ready exports in one click\n          </span>\n          <h2>Design files your printer will actually love</h2>\n          <p>Halftone checks bleed, color profiles and fonts before anything leaves your desk.</p>\n        </div>\n      )}\n    </header>\n  );\n}\n"
    }
  ]
}