{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "navbar-hamburger-morph",
  "type": "registry:component",
  "title": "Navbar Hamburger Morph",
  "description": "A studio header with a Menu pill whose lines fold into a cross while the label rolls to Close, and a full-screen menu that grows out of the button in a circle. Oversized numbered links rise in sequence, with contact, socials and availability beside them.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "navigation",
    "navbar",
    "hamburger",
    "fullscreen menu",
    "mobile",
    "focus trap",
    "studio"
  ],
  "docs": "https://hyperblur.dev/effects/navbar-hamburger-morph",
  "files": [
    {
      "path": "registry/hyperblur/navbar-hamburger-morph.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/navbar-hamburger-morph.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface NavbarHamburgerMorphLink {\n  label: string;\n  href: string;\n  note?: string;\n}\n\nexport interface NavbarHamburgerMorphProps extends Omit<React.HTMLAttributes<HTMLElement>, \"children\"> {\n  brand?: string;\n  tagline?: string;\n  links?: NavbarHamburgerMorphLink[];\n  socials?: NavbarHamburgerMorphLink[];\n  email?: string;\n  address?: string;\n  availability?: string | null;\n  cta?: { label: string; href: string } | null;\n  open?: boolean;\n  defaultOpen?: boolean;\n  onOpenChange?: (open: boolean) => void;\n  embedded?: boolean;\n  accent?: string;\n  paper?: string;\n  showBackdrop?: boolean;\n}\n\nconst css = `\n.hb-xi8 {\n  --hb-xi8-accent: #ff5b2e;\n  --hb-xi8-paper: #ece8df;\n  --hb-xi8-ink: #121110;\n  --hb-xi8-ease: cubic-bezier(.76,0,.24,1);\n  --hb-xi8-out: cubic-bezier(.22,1,.36,1);\n  --hb-xi8-cx: calc(100% - 60px);\n  --hb-xi8-cy: 40px;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  container-type: inline-size;\n  background: #0c0c0b;\n  color: #f2efe8;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-xi8 *, .hb-xi8 *::before, .hb-xi8 *::after { box-sizing: border-box; }\n.hb-xi8-bar { position: relative; z-index: 62; transition: color .5s var(--hb-xi8-ease) .1s; }\n.hb-xi8[data-open=\"true\"] .hb-xi8-bar { color: var(--hb-xi8-ink); }\n.hb-xi8-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; max-width: 1200px; height: 80px; margin: 0 auto; padding: 0 28px; }\n.hb-xi8-brand { justify-self: start; display: inline-flex; align-items: baseline; gap: 2px; color: inherit; font-family: var(--font-grotesk, inherit); font-size: 22px; font-weight: 700; letter-spacing: -.05em; text-decoration: none; border-radius: 6px; }\n.hb-xi8-brand span { color: var(--hb-xi8-accent); }\n.hb-xi8-tag { color: currentColor; opacity: .55; font-size: 13px; white-space: nowrap; transition: opacity .3s ease; }\n.hb-xi8-end { justify-self: end; display: flex; align-items: center; gap: 10px; }\n.hb-xi8-talk { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px; box-shadow: 0 0 0 1px currentColor inset; color: inherit; font-size: 14px; font-weight: 500; text-decoration: none; opacity: .9; transition: background-color .3s ease, color .3s ease, opacity .3s ease; }\n.hb-xi8-talk:hover { background: #f2efe8; color: #0c0c0b; opacity: 1; }\n.hb-xi8[data-open=\"true\"] .hb-xi8-talk { opacity: 0; pointer-events: none; }\n.hb-xi8-btn {\n  position: relative;\n  display: inline-flex;\n  align-items: center;\n  gap: 12px;\n  height: 48px;\n  margin: 0;\n  padding: 0 8px 0 20px;\n  border: 0;\n  border-radius: 999px;\n  background: #f2efe8;\n  color: #0c0c0b;\n  font: inherit;\n  font-size: 14px;\n  font-weight: 600;\n  cursor: pointer;\n  box-shadow: 0 1px 0 #fff inset, 0 10px 24px -12px rgba(0,0,0,.6);\n  transition: background-color .5s var(--hb-xi8-ease), color .5s var(--hb-xi8-ease), transform .2s var(--hb-xi8-out);\n}\n.hb-xi8-btn:active { transform: scale(.96); }\n.hb-xi8[data-open=\"true\"] .hb-xi8-btn { background: var(--hb-xi8-ink); color: var(--hb-xi8-paper); box-shadow: 0 10px 24px -12px rgba(0,0,0,.5); }\n.hb-xi8-roll { position: relative; display: block; height: 18px; overflow: hidden; line-height: 18px; }\n.hb-xi8-roll span { display: block; transition: transform .55s var(--hb-xi8-ease); }\n.hb-xi8[data-open=\"true\"] .hb-xi8-roll span { transform: translateY(-100%); }\n.hb-xi8-ico { position: relative; display: block; width: 32px; height: 32px; border-radius: 50%; background: var(--hb-xi8-accent); }\n.hb-xi8-ico i { position: absolute; left: 9px; width: 14px; height: 1.8px; border-radius: 2px; background: #fff; font-style: normal; transition: transform .55s var(--hb-xi8-ease), top .55s var(--hb-xi8-ease), width .4s var(--hb-xi8-ease), opacity .3s ease; }\n.hb-xi8-ico i:nth-child(1) { top: 11px; }\n.hb-xi8-ico i:nth-child(2) { top: 15.1px; width: 9px; }\n.hb-xi8-ico i:nth-child(3) { top: 19.2px; width: 11px; }\n.hb-xi8-btn:hover .hb-xi8-ico i:nth-child(2), .hb-xi8-btn:hover .hb-xi8-ico i:nth-child(3) { width: 14px; }\n.hb-xi8[data-open=\"true\"] .hb-xi8-ico i:nth-child(1) { top: 15.1px; transform: rotate(45deg); transition-delay: .1s; }\n.hb-xi8[data-open=\"true\"] .hb-xi8-ico i:nth-child(2) { width: 0; opacity: 0; }\n.hb-xi8[data-open=\"true\"] .hb-xi8-ico i:nth-child(3) { top: 15.1px; width: 14px; transform: rotate(-45deg); transition-delay: .1s; }\n.hb-xi8-veil {\n  position: fixed;\n  inset: 0;\n  z-index: 61;\n  height: 100dvh;\n  overflow-y: auto;\n  background: var(--hb-xi8-paper);\n  color: var(--hb-xi8-ink);\n  clip-path: circle(0px at var(--hb-xi8-cx) var(--hb-xi8-cy));\n  visibility: hidden;\n  transition: clip-path .8s var(--hb-xi8-ease), visibility 0s linear .8s;\n}\n.hb-xi8[data-embedded=\"true\"] .hb-xi8-veil { position: absolute; height: auto; min-height: 100%; }\n.hb-xi8[data-open=\"true\"] .hb-xi8-veil { clip-path: circle(150% at var(--hb-xi8-cx) var(--hb-xi8-cy)); visibility: visible; transition: clip-path .9s var(--hb-xi8-ease), visibility 0s; }\n.hb-xi8-in { display: grid; grid-template-columns: 1fr 300px; gap: 48px; max-width: 1200px; min-height: 100%; margin: 0 auto; padding: 120px 28px 32px; }\n.hb-xi8-list { margin: 0; padding: 0; list-style: none; counter-reset: hb-xi8-n; }\n.hb-xi8-li { overflow: hidden; border-top: 1px solid rgba(18,17,16,.12); }\n.hb-xi8-li:last-child { border-bottom: 1px solid rgba(18,17,16,.12); }\n.hb-xi8-a {\n  display: flex;\n  align-items: center;\n  gap: 18px;\n  padding: 10px 0;\n  color: inherit;\n  font-family: var(--font-grotesk, var(--font-sans, ui-sans-serif, system-ui, sans-serif));\n  font-size: clamp(36px, 6.4cqi, 78px);\n  font-weight: 600;\n  letter-spacing: -.055em;\n  line-height: 1;\n  text-decoration: none;\n  transform: translateY(110%);\n  transition: transform .5s var(--hb-xi8-ease), opacity .35s ease, color .3s ease;\n}\n.hb-xi8[data-open=\"true\"] .hb-xi8-a { transform: translateY(0); transition: transform .9s var(--hb-xi8-out) calc(.28s + var(--hb-xi8-i) * .06s), opacity .35s ease, color .3s ease; }\n.hb-xi8-num { align-self: flex-start; margin-top: .3em; font-family: var(--font-mono, ui-monospace, monospace); font-size: 12px; font-weight: 500; letter-spacing: 0; opacity: .5; }\n.hb-xi8-txt { transition: transform .5s var(--hb-xi8-out); }\n.hb-xi8-note { margin-left: auto; font-family: var(--font-sans, inherit); font-size: 13px; font-weight: 500; letter-spacing: 0; opacity: .55; }\n.hb-xi8-arr { display: grid; place-items: center; width: .7em; height: .7em; border-radius: 50%; background: var(--hb-xi8-accent); color: #fff; transform: scale(0) rotate(-45deg); transition: transform .45s var(--hb-xi8-out); }\n.hb-xi8-arr svg { width: 40%; height: 40%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }\n.hb-xi8-list:hover .hb-xi8-a, .hb-xi8-list:focus-within .hb-xi8-a { opacity: .28; }\n.hb-xi8-list .hb-xi8-a:hover, .hb-xi8-list .hb-xi8-a:focus-visible { opacity: 1; }\n.hb-xi8-a:hover .hb-xi8-txt, .hb-xi8-a:focus-visible .hb-xi8-txt { transform: translateX(14px); }\n.hb-xi8-a:hover .hb-xi8-arr, .hb-xi8-a:focus-visible .hb-xi8-arr { transform: scale(1) rotate(0deg); }\n.hb-xi8-a[aria-current=\"page\"] .hb-xi8-num { color: var(--hb-xi8-accent); opacity: 1; }\n.hb-xi8-side { display: flex; flex-direction: column; gap: 28px; padding-top: 12px; opacity: 0; transform: translateY(16px); transition: opacity .3s ease, transform .5s var(--hb-xi8-ease); }\n.hb-xi8[data-open=\"true\"] .hb-xi8-side { opacity: 1; transform: none; transition: opacity .6s ease .55s, transform .9s var(--hb-xi8-out) .5s; }\n.hb-xi8-k { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .5; }\n.hb-xi8-mail { color: inherit; font-size: 20px; font-weight: 600; letter-spacing: -.02em; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: rgba(18,17,16,.3); transition: text-decoration-color .2s ease; }\n.hb-xi8-mail:hover { text-decoration-color: var(--hb-xi8-accent); }\n.hb-xi8-soc { display: flex; flex-wrap: wrap; gap: 8px; }\n.hb-xi8-soc a { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 999px; box-shadow: 0 0 0 1px rgba(18,17,16,.18) inset; color: inherit; font-size: 13px; font-weight: 500; text-decoration: none; transition: background-color .2s ease, color .2s ease; }\n.hb-xi8-soc a:hover { background: var(--hb-xi8-ink); color: var(--hb-xi8-paper); }\n.hb-xi8-addr { margin: 0; font-size: 14px; line-height: 1.55; opacity: .75; white-space: pre-line; }\n.hb-xi8-avail { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; margin-top: auto; padding: 10px 14px; border-radius: 12px; background: rgba(18,17,16,.06); font-size: 13px; font-weight: 500; }\n.hb-xi8-avail::before { content: \"\"; width: 8px; height: 8px; border-radius: 50%; background: #1fae5b; box-shadow: 0 0 0 0 rgba(31,174,91,.5); animation: hb-xi8-ping 2s ease-out infinite; }\n.hb-xi8 a:focus-visible, .hb-xi8 button:focus-visible { outline: 2px solid var(--hb-xi8-accent); outline-offset: 3px; }\n.hb-xi8-stage { position: relative; height: 640px; overflow: hidden; }\n.hb-xi8-hero { max-width: 1200px; margin: 0 auto; padding: 60px 28px 0; }\n.hb-xi8-h { margin: 0; font-family: var(--font-grotesk, var(--font-sans, ui-sans-serif, system-ui, sans-serif)); font-size: clamp(40px, 8cqi, 104px); font-weight: 600; letter-spacing: -.06em; line-height: .92; }\n.hb-xi8-h span { color: var(--hb-xi8-accent); }\n.hb-xi8-work { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 16px; margin-top: 44px; }\n.hb-xi8-work span { height: 240px; border-radius: 16px; }\n@keyframes hb-xi8-ping { 0% { box-shadow: 0 0 0 0 rgba(31,174,91,.5); } 80%, 100% { box-shadow: 0 0 0 8px rgba(31,174,91,0); } }\n@container (max-width: 760px) {\n  .hb-xi8-row { grid-template-columns: 1fr auto; height: 68px; padding: 0 16px; }\n  .hb-xi8-tag, .hb-xi8-talk { display: none; }\n  .hb-xi8-btn { height: 44px; padding: 0 6px 0 16px; }\n  .hb-xi8-in { grid-template-columns: 1fr; gap: 32px; padding: 92px 16px 24px; }\n  .hb-xi8-a { font-size: clamp(34px, 11cqi, 52px); padding: 8px 0; }\n  .hb-xi8-note { display: none; }\n  .hb-xi8-side { gap: 20px; }\n  .hb-xi8-work { grid-template-columns: 1fr 1fr; }\n  .hb-xi8-work span:first-child { grid-column: 1 / -1; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-xi8 *, .hb-xi8 *::before, .hb-xi8 *::after { animation: none !important; transition: none !important; }\n}\n`;\n\nconst defaultLinks: NavbarHamburgerMorphLink[] = [\n  { label: \"Work\", href: \"#\", note: \"32 projects\" },\n  { label: \"Studio\", href: \"#\", note: \"Since 2014\" },\n  { label: \"Services\", href: \"#\", note: \"Brand, product, spatial\" },\n  { label: \"Journal\", href: \"#\", note: \"Latest: On quiet interfaces\" },\n  { label: \"Contact\", href: \"#\" },\n];\n\nconst defaultSocials: NavbarHamburgerMorphLink[] = [\n  { label: \"Instagram\", href: \"#\" },\n  { label: \"LinkedIn\", href: \"#\" },\n  { label: \"Dribbble\", href: \"#\" },\n  { label: \"Are.na\", href: \"#\" },\n];\n\nexport function NavbarHamburgerMorph({\n  brand = \"Wren\",\n  tagline = \"Independent design studio, Lisbon\",\n  links = defaultLinks,\n  socials = defaultSocials,\n  email = \"hello@wren.studio\",\n  address = \"Rua da Boavista 84\\n1200-066 Lisbon, Portugal\",\n  availability = \"Taking new projects for Q1 2027\",\n  cta = { label: \"Let's talk\", href: \"#\" },\n  open,\n  defaultOpen = false,\n  onOpenChange,\n  embedded = false,\n  accent = \"#ff5b2e\",\n  paper = \"#ece8df\",\n  showBackdrop = true,\n  className = \"\",\n  style,\n  ...rest\n}: NavbarHamburgerMorphProps) {\n  const uid = React.useId();\n  const rootRef = React.useRef<HTMLElement>(null);\n  const btnRef = React.useRef<HTMLButtonElement>(null);\n  const veilRef = React.useRef<HTMLDivElement>(null);\n  const userToggled = React.useRef(false);\n  const [inner, setInner] = React.useState(defaultOpen);\n  const isOpen = open ?? inner;\n\n  const setOpen = (v: boolean) => {\n    userToggled.current = true;\n    const root = rootRef.current;\n    const btn = btnRef.current;\n    if (v && root && btn) {\n      const ico = btn.querySelector<HTMLElement>(\".hb-xi8-ico\") ?? btn;\n      const r = ico.getBoundingClientRect();\n      const box = embedded ? root.getBoundingClientRect() : { left: 0, top: 0 };\n      root.style.setProperty(\"--hb-xi8-cx\", `${(r.left + r.width / 2 - box.left).toFixed(1)}px`);\n      root.style.setProperty(\"--hb-xi8-cy\", `${(r.top + r.height / 2 - box.top).toFixed(1)}px`);\n    }\n    if (open === undefined) setInner(v);\n    onOpenChange?.(v);\n  };\n\n  React.useEffect(() => {\n    if (!isOpen || embedded) return;\n    const prev = document.body.style.overflow;\n    document.body.style.overflow = \"hidden\";\n    return () => {\n      document.body.style.overflow = prev;\n    };\n  }, [isOpen, embedded]);\n\n  React.useEffect(() => {\n    if (!userToggled.current) return;\n    if (isOpen) {\n      const first = veilRef.current?.querySelector<HTMLElement>(\"a[href]\");\n      const t = window.setTimeout(() => first?.focus({ preventScroll: true }), 120);\n      return () => window.clearTimeout(t);\n    }\n    btnRef.current?.focus({ preventScroll: true });\n  }, [isOpen]);\n\n  const onKeyDown = (e: React.KeyboardEvent<HTMLElement>) => {\n    if (!isOpen) return;\n    if (e.key === \"Escape\") {\n      e.preventDefault();\n      setOpen(false);\n      return;\n    }\n    if (e.key !== \"Tab\") return;\n    const veil = veilRef.current;\n    const btn = btnRef.current;\n    if (!veil || !btn) return;\n    const nodes = [btn, ...Array.from(veil.querySelectorAll<HTMLElement>(\"a[href], button:not([disabled])\"))];\n    const first = nodes[0];\n    const last = nodes[nodes.length - 1];\n    const at = document.activeElement;\n    if (!nodes.includes(at as HTMLElement)) {\n      e.preventDefault();\n      first.focus();\n    } else if (e.shiftKey && at === first) {\n      e.preventDefault();\n      last.focus();\n    } else if (!e.shiftKey && at === last) {\n      e.preventDefault();\n      first.focus();\n    }\n  };\n\n  const arrow = (\n    <svg viewBox=\"0 0 12 12\" aria-hidden=\"true\">\n      <path d=\"M2.5 9.5l7-7M4 2.5h5.5V8\" />\n    </svg>\n  );\n\n  return (\n    <header\n      ref={rootRef}\n      className={`hb-xi8 ${className}`}\n      data-open={isOpen ? \"true\" : \"false\"}\n      data-embedded={embedded ? \"true\" : \"false\"}\n      style={{ \"--hb-xi8-accent\": accent, \"--hb-xi8-paper\": paper, ...style } as React.CSSProperties}\n      onKeyDown={onKeyDown}\n      {...rest}\n    >\n      <style href=\"hb-navbar-hamburger-morph\" precedence=\"default\">\n        {css}\n      </style>\n      <div className=\"hb-xi8-bar\">\n        <div className=\"hb-xi8-row\">\n          <a href=\"#\" className=\"hb-xi8-brand\" aria-label={`${brand} home`} tabIndex={isOpen ? -1 : undefined}>\n            {brand}\n            <span>.</span>\n          </a>\n          <span className=\"hb-xi8-tag\">{tagline}</span>\n          <div className=\"hb-xi8-end\">\n            {cta && (\n              <a href={cta.href} className=\"hb-xi8-talk\" tabIndex={isOpen ? -1 : undefined}>\n                {cta.label}\n              </a>\n            )}\n            <button\n              ref={btnRef}\n              type=\"button\"\n              className=\"hb-xi8-btn\"\n              aria-expanded={isOpen}\n              aria-controls={`${uid}-menu`}\n              aria-label={isOpen ? \"Close menu\" : \"Open menu\"}\n              onClick={() => setOpen(!isOpen)}\n            >\n              <span className=\"hb-xi8-roll\" aria-hidden=\"true\">\n                <span>Menu</span>\n                <span>Close</span>\n              </span>\n              <span className=\"hb-xi8-ico\" aria-hidden=\"true\">\n                <i />\n                <i />\n                <i />\n              </span>\n            </button>\n          </div>\n        </div>\n      </div>\n      <div\n        ref={veilRef}\n        id={`${uid}-menu`}\n        className=\"hb-xi8-veil\"\n        role=\"dialog\"\n        aria-modal={isOpen ? \"true\" : undefined}\n        aria-label=\"Site menu\"\n        aria-hidden={!isOpen}\n        inert={!isOpen}\n      >\n        <div className=\"hb-xi8-in\">\n          <nav aria-label=\"Main\">\n            <ul className=\"hb-xi8-list\">\n              {links.map((link, i) => (\n                <li key={link.label} className=\"hb-xi8-li\">\n                  <a\n                    href={link.href}\n                    className=\"hb-xi8-a\"\n                    aria-current={i === 0 ? \"page\" : undefined}\n                    style={{ \"--hb-xi8-i\": i } as React.CSSProperties}\n                    onClick={() => setOpen(false)}\n                  >\n                    <span className=\"hb-xi8-num\">{String(i + 1).padStart(2, \"0\")}</span>\n                    <span className=\"hb-xi8-txt\">{link.label}</span>\n                    <span className=\"hb-xi8-arr\" aria-hidden=\"true\">\n                      {arrow}\n                    </span>\n                    {link.note && <span className=\"hb-xi8-note\">{link.note}</span>}\n                  </a>\n                </li>\n              ))}\n            </ul>\n          </nav>\n          <div className=\"hb-xi8-side\">\n            <div>\n              <p className=\"hb-xi8-k\">New business</p>\n              <a href={`mailto:${email}`} className=\"hb-xi8-mail\">\n                {email}\n              </a>\n            </div>\n            {socials.length > 0 && (\n              <div>\n                <p className=\"hb-xi8-k\">Follow</p>\n                <div className=\"hb-xi8-soc\">\n                  {socials.map((s) => (\n                    <a key={s.label} href={s.href}>\n                      {s.label}\n                    </a>\n                  ))}\n                </div>\n              </div>\n            )}\n            <div>\n              <p className=\"hb-xi8-k\">Studio</p>\n              <p className=\"hb-xi8-addr\">{address}</p>\n            </div>\n            {availability && <span className=\"hb-xi8-avail\">{availability}</span>}\n          </div>\n        </div>\n      </div>\n      {showBackdrop && (\n        <div className=\"hb-xi8-stage\" aria-hidden=\"true\">\n          <div className=\"hb-xi8-hero\">\n            <h2 className=\"hb-xi8-h\">\n              Spaces, brands and\n              <br />\n              products with <span>nerve.</span>\n            </h2>\n            <div className=\"hb-xi8-work\">\n              <span style={{ background: \"linear-gradient(150deg, #d9b48f, #6b3f2a)\" }} />\n              <span style={{ background: \"linear-gradient(150deg, #9fb7c9, #2c3e50)\" }} />\n              <span style={{ background: \"linear-gradient(150deg, #c7c9a1, #4a4f2a)\" }} />\n            </div>\n          </div>\n        </div>\n      )}\n    </header>\n  );\n}\n"
    }
  ]
}