{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "header-14",
  "title": "Capsule Nav Header Without A CTA",
  "description": "Header with the wordmark on the left and the navigation collected into one muted capsule on the right, with a sliding active pill and no call to action.",
  "dependencies": [
    "motion",
    "@base-ui/react"
  ],
  "registryDependencies": [
    "button",
    "sheet"
  ],
  "files": [
    {
      "path": "registry/blocks/header/14/header-block.tsx",
      "content": "\"use client\"\n\nimport { useEffect, useRef, useState } from \"react\"\nimport { motion, useReducedMotion } from \"motion/react\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n  Sheet,\n  SheetClose,\n  SheetContent,\n  SheetHeader,\n  SheetTitle,\n  SheetTrigger,\n} from \"@/components/ui/sheet\"\nimport { cn } from \"@/lib/utils\"\nimport { IconPlaceholder } from \"@/components/icons/icon-placeholder\"\n\nconst pillSpring = { type: \"spring\" as const, stiffness: 400, damping: 34 }\n\nconst sections = [\n  { id: \"overview\", label: \"Overview\" },\n  { id: \"features\", label: \"Features\" },\n  { id: \"pricing\", label: \"Pricing\" },\n  { id: \"faq\", label: \"FAQ\" },\n]\n\nexport default function HeaderBlock() {\n  const reduce = useReducedMotion()\n  const [open, setOpen] = useState(false)\n  const [active, setActive] = useState(0)\n  const [hovered, setHovered] = useState<number | null>(null)\n  const navRef = useRef<HTMLElement>(null)\n\n  const { anchorRef, scrolled } = useAncestorScroll()\n\n  useEffect(() => {\n    const root = findScrollParent(navRef.current)\n    const els = sections\n      .map((s) => document.getElementById(s.id))\n      .filter((el): el is HTMLElement => el !== null)\n    if (els.length === 0) return\n\n    const io = new IntersectionObserver(\n      (entries) => {\n        for (const entry of entries) {\n          if (!entry.isIntersecting) continue\n          const index = els.indexOf(entry.target as HTMLElement)\n          if (index !== -1) setActive(index)\n        }\n      },\n      { root, rootMargin: \"-45% 0px -50% 0px\", threshold: 0 }\n    )\n    els.forEach((el) => io.observe(el))\n    return () => io.disconnect()\n  }, [])\n\n  const shown = hovered ?? active\n\n  return (\n    <header\n      ref={anchorRef}\n      className={cn(\n        \"sticky top-0 z-40 w-full border-b bg-background/85 backdrop-blur transition-colors duration-300\",\n        scrolled ? \"border-border\" : \"border-transparent\"\n      )}\n    >\n      <div className=\"mx-auto flex h-16 w-full max-w-6xl items-center gap-6 px-6\">\n        <a href=\"#\" className=\"flex shrink-0 items-center gap-2.5\">\n          <svg\n            viewBox=\"0 0 24 24\"\n            fill=\"currentColor\"\n            aria-hidden=\"true\"\n            className=\"size-6 shrink-0 text-primary\"\n          >\n            <rect x=\"3\" y=\"3\" width=\"8\" height=\"8\" transform=\"rotate(-6 7 7)\" />\n            <rect\n              x=\"3\"\n              y=\"13\"\n              width=\"8\"\n              height=\"8\"\n              transform=\"rotate(5 7 17)\"\n            />\n            <rect\n              x=\"13\"\n              y=\"13\"\n              width=\"8\"\n              height=\"8\"\n              transform=\"rotate(-4 17 17)\"\n            />\n            <rect\n              x=\"13\"\n              y=\"3\"\n              width=\"8\"\n              height=\"8\"\n              transform=\"rotate(15 17 7)\"\n            />\n          </svg>\n          <span className=\"text-base font-bold tracking-tight\">Acme</span>\n        </a>\n\n        <nav\n          ref={navRef}\n          onMouseLeave={() => setHovered(null)}\n          onBlur={(e) => {\n            if (!e.currentTarget.contains(e.relatedTarget as Node))\n              setHovered(null)\n          }}\n          className=\"ml-auto hidden items-center gap-0.5 rounded-[calc(var(--radius-md)+4px)] border border-border bg-muted/60 p-1 backdrop-blur md:flex\"\n        >\n          {sections.map((s, i) => {\n            const isShown = shown === i\n            return (\n              <a\n                key={s.id}\n                href={`#${s.id}`}\n                aria-current={active === i ? \"true\" : undefined}\n                onMouseEnter={() => setHovered(i)}\n                onFocus={() => setHovered(i)}\n                onClick={() => setActive(i)}\n                className={cn(\n                  \"relative rounded-md px-3.5 py-1.5 text-sm font-medium transition-colors\",\n                  isShown\n                    ? \"text-foreground\"\n                    : \"text-muted-foreground hover:text-foreground\"\n                )}\n              >\n                {isShown && (\n                  <motion.span\n                    layoutId=\"header-14-pill\"\n                    aria-hidden=\"true\"\n                    transition={reduce ? { duration: 0 } : pillSpring}\n                    className=\"absolute inset-0 -z-10 rounded-md bg-background shadow-sm\"\n                  />\n                )}\n                {s.label}\n              </a>\n            )\n          })}\n        </nav>\n\n        <Sheet open={open} onOpenChange={setOpen}>\n          <SheetTrigger\n            render={\n              <Button\n                variant=\"outline\"\n                size=\"icon\"\n                aria-label=\"Open menu\"\n                className=\"ml-auto md:hidden\"\n              />\n            }\n          >\n            <IconPlaceholder\n              lucide=\"Menu\"\n              tabler=\"IconMenu\"\n              hugeicons=\"MenuIcon\"\n              phosphor=\"List\"\n              remixicon=\"RiMenuLine\"\n              aria-hidden=\"true\"\n            />\n          </SheetTrigger>\n          <SheetContent side=\"right\" className=\"w-3/4 max-w-xs\">\n            <SheetHeader>\n              <SheetTitle className=\"flex items-center gap-2.5\">\n                <svg\n                  viewBox=\"0 0 24 24\"\n                  fill=\"currentColor\"\n                  aria-hidden=\"true\"\n                  className=\"size-5 shrink-0 text-primary\"\n                >\n                  <rect\n                    x=\"3\"\n                    y=\"3\"\n                    width=\"8\"\n                    height=\"8\"\n                    transform=\"rotate(-6 7 7)\"\n                  />\n                  <rect\n                    x=\"3\"\n                    y=\"13\"\n                    width=\"8\"\n                    height=\"8\"\n                    transform=\"rotate(5 7 17)\"\n                  />\n                  <rect\n                    x=\"13\"\n                    y=\"13\"\n                    width=\"8\"\n                    height=\"8\"\n                    transform=\"rotate(-4 17 17)\"\n                  />\n                  <rect\n                    x=\"13\"\n                    y=\"3\"\n                    width=\"8\"\n                    height=\"8\"\n                    transform=\"rotate(15 17 7)\"\n                  />\n                </svg>\n                Acme\n              </SheetTitle>\n            </SheetHeader>\n\n            <nav className=\"flex flex-col px-4\">\n              {sections.map((s, i) => (\n                <SheetClose\n                  key={s.id}\n                  nativeButton={false}\n                  render={\n                    <a\n                      href={`#${s.id}`}\n                      className={cn(\n                        \"border-l-2 py-3 pl-3 text-sm font-medium transition-colors\",\n                        active === i\n                          ? \"border-primary bg-muted/60 text-foreground\"\n                          : \"border-transparent text-muted-foreground hover:text-foreground\"\n                      )}\n                    />\n                  }\n                >\n                  {s.label}\n                </SheetClose>\n              ))}\n            </nav>\n          </SheetContent>\n        </Sheet>\n      </div>\n    </header>\n  )\n}\n\nfunction findScrollParent(node: HTMLElement | null): HTMLElement | null {\n  let el = node?.parentElement ?? null\n  while (el) {\n    const overflowY = getComputedStyle(el).overflowY\n    if (\n      (overflowY === \"auto\" || overflowY === \"scroll\") &&\n      el.scrollHeight > el.clientHeight\n    ) {\n      return el\n    }\n    el = el.parentElement\n  }\n  return null\n}\n\nfunction useAncestorScroll() {\n  const anchorRef = useRef<HTMLElement>(null)\n  const [scrolled, setScrolled] = useState(false)\n\n  useEffect(() => {\n    const anchor = anchorRef.current\n    if (!anchor) return\n    const scroller = findScrollParent(anchor)\n    const target: HTMLElement | Window = scroller ?? window\n    const read = () =>\n      setScrolled((scroller ? scroller.scrollTop : window.scrollY) > 8)\n    read()\n    target.addEventListener(\"scroll\", read, { passive: true })\n    window.addEventListener(\"resize\", read)\n    return () => {\n      target.removeEventListener(\"scroll\", read)\n      window.removeEventListener(\"resize\", read)\n    }\n  }, [])\n\n  return { anchorRef, scrolled }\n}\n",
      "type": "registry:component",
      "target": "components/blocks/header-14.tsx"
    }
  ],
  "meta": {
    "height": "540px",
    "tier": "free"
  },
  "docs": "Requires a `base-*` style in components.json (the `shadcn init` default). Legacy `new-york`/`radix-*` styles install Radix primitives, which reject the `render` prop this block uses.",
  "categories": [
    "header"
  ],
  "type": "registry:block"
}