{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "blog-article-header",
  "type": "registry:component",
  "title": "Blog Article Header",
  "description": "The top of a single article: breadcrumb, large title that blurs in word by word, author block, share buttons, a reading progress bar and an opening paragraph with a drop cap.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "blog",
    "blog",
    "article",
    "header",
    "progress",
    "drop cap",
    "share"
  ],
  "docs": "https://hyperblur.dev/effects/blog-article-header",
  "files": [
    {
      "path": "registry/hyperblur/blog-article-header.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/blog-article-header.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport type ArticleShareNetwork = \"x\" | \"linkedin\" | \"copy\";\n\nexport interface ArticleAuthor {\n  name: string;\n  role?: string;\n}\n\nexport interface BlogArticleHeaderProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  breadcrumbs?: { label: string; href: string }[];\n  category?: string;\n  title?: string;\n  dek?: string;\n  author?: ArticleAuthor;\n  date?: string;\n  readTime?: string;\n  updated?: string;\n  progress?: number;\n  intro?: string;\n  body?: string[];\n  shareUrl?: string;\n  onShare?: (network: ArticleShareNetwork) => void;\n  accent?: string;\n}\n\nconst css = `\n.hb-ki3 {\n  --hb-ki3-accent: #22d3ee;\n  box-sizing: border-box;\n  position: relative;\n  width: 100%;\n  container-type: inline-size;\n  background:\n    radial-gradient(70% 50% at 50% 0%, color-mix(in srgb, var(--hb-ki3-accent) 12%, transparent), transparent 70%),\n    #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-ki3 *, .hb-ki3 *::before, .hb-ki3 *::after { box-sizing: border-box; }\n.hb-ki3-progress {\n  position: sticky;\n  top: 0;\n  z-index: 3;\n  height: 3px;\n  background: rgba(255,255,255,.06);\n}\n.hb-ki3-fill {\n  height: 100%;\n  background: linear-gradient(90deg, color-mix(in srgb, var(--hb-ki3-accent) 40%, transparent), var(--hb-ki3-accent));\n  box-shadow: 0 0 14px color-mix(in srgb, var(--hb-ki3-accent) 60%, transparent);\n  transform: scaleX(var(--hb-ki3-p, 0));\n  transform-origin: left;\n  transition: transform .5s cubic-bezier(.2,.7,.2,1);\n  animation: hb-ki3-fill 1.4s cubic-bezier(.2,.7,.2,1) both;\n}\n.hb-ki3-inner {\n  max-width: 1120px;\n  margin: 0 auto;\n  padding: clamp(40px, 7cqi, 88px) clamp(18px, 4cqi, 40px) clamp(56px, 9cqi, 112px);\n}\n.hb-ki3-col { max-width: 760px; margin: 0 auto; }\n.hb-ki3-crumbs { margin: 0 0 28px; }\n.hb-ki3-crumbs ol {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: center;\n  gap: 6px;\n  margin: 0;\n  padding: 0;\n  list-style: none;\n  font-size: 13px;\n}\n.hb-ki3-crumbs li { display: inline-flex; align-items: center; gap: 6px; color: #8f8f8f; }\n.hb-ki3-crumbs a {\n  color: #8f8f8f;\n  text-decoration: none;\n  border-radius: 4px;\n  transition: color .2s ease;\n}\n.hb-ki3-crumbs a:hover { color: #ededed; }\n.hb-ki3-crumbs a:focus-visible { outline: 2px solid var(--hb-ki3-accent); outline-offset: 2px; }\n.hb-ki3-crumbs li[aria-current=\"page\"] { color: #d4d4d4; }\n.hb-ki3-crumbs svg { width: 12px; height: 12px; color: #4a4a4a; }\n.hb-ki3-cat {\n  display: inline-flex;\n  align-items: center;\n  gap: 8px;\n  height: 26px;\n  margin-bottom: 18px;\n  padding: 0 11px;\n  border: 1px solid color-mix(in srgb, var(--hb-ki3-accent) 35%, transparent);\n  border-radius: 999px;\n  background: color-mix(in srgb, var(--hb-ki3-accent) 10%, transparent);\n  color: color-mix(in srgb, var(--hb-ki3-accent) 75%, #fff);\n  font-size: 12px;\n  font-weight: 600;\n  letter-spacing: .03em;\n}\n.hb-ki3-cat::before {\n  content: \"\";\n  width: 6px;\n  height: 6px;\n  border-radius: 50%;\n  background: var(--hb-ki3-accent);\n  box-shadow: 0 0 10px var(--hb-ki3-accent);\n}\n.hb-ki3-title {\n  margin: 0;\n  font-size: clamp(32px, 6.2cqi, 60px);\n  font-weight: 650;\n  line-height: 1.04;\n  letter-spacing: -.04em;\n  text-wrap: balance;\n}\n.hb-ki3-word {\n  display: inline-block;\n  animation: hb-ki3-word .8s cubic-bezier(.2,.7,.2,1) both;\n  animation-delay: var(--hb-ki3-d, 0ms);\n}\n.hb-ki3-dek {\n  margin: 20px 0 0;\n  color: #a1a1a1;\n  font-size: clamp(16px, 2cqi, 19px);\n  line-height: 1.55;\n  text-wrap: pretty;\n  animation: hb-ki3-word .8s .35s cubic-bezier(.2,.7,.2,1) both;\n}\n.hb-ki3-byline {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: center;\n  justify-content: space-between;\n  gap: 18px;\n  margin-top: 32px;\n  padding: 18px 0;\n  border-top: 1px solid rgba(255,255,255,.08);\n  border-bottom: 1px solid rgba(255,255,255,.08);\n}\n.hb-ki3-author { display: flex; align-items: center; gap: 12px; min-width: 0; }\n.hb-ki3-avatar {\n  display: grid;\n  place-items: center;\n  flex: none;\n  width: 44px;\n  height: 44px;\n  border-radius: 50%;\n  background:\n    radial-gradient(circle at 30% 25%, rgba(255,255,255,.4), transparent 45%),\n    linear-gradient(135deg, var(--hb-ki3-accent), #1e3a8a);\n  box-shadow: 0 0 0 3px #0a0a0a, 0 0 0 4px rgba(255,255,255,.12);\n  color: #fff;\n  font-size: 14px;\n  font-weight: 700;\n}\n.hb-ki3-who { display: grid; gap: 3px; min-width: 0; }\n.hb-ki3-name { font-size: 14.5px; font-weight: 600; }\n.hb-ki3-meta {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: center;\n  gap: 4px 10px;\n  color: #8f8f8f;\n  font-size: 13px;\n}\n.hb-ki3-meta span { display: inline-flex; align-items: center; gap: 6px; }\n.hb-ki3-meta svg { width: 14px; height: 14px; }\n.hb-ki3-share { display: flex; align-items: center; gap: 8px; }\n.hb-ki3-sbtn {\n  position: relative;\n  display: inline-grid;\n  place-items: center;\n  width: 36px;\n  height: 36px;\n  margin: 0;\n  padding: 0;\n  border: 1px solid rgba(255,255,255,.1);\n  border-radius: 10px;\n  background: #111;\n  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);\n  color: #d4d4d4;\n  font: inherit;\n  text-decoration: none;\n  cursor: pointer;\n  transition: border-color .2s ease, color .2s ease, transform .15s ease, background-color .2s ease;\n}\n.hb-ki3-sbtn:hover { border-color: color-mix(in srgb, var(--hb-ki3-accent) 50%, transparent); color: #fff; background: #171717; }\n.hb-ki3-sbtn:active { transform: scale(.94); }\n.hb-ki3-sbtn:focus-visible { outline: 2px solid var(--hb-ki3-accent); outline-offset: 2px; }\n.hb-ki3-sbtn svg { width: 16px; height: 16px; }\n.hb-ki3-sbtn[data-done=\"true\"] { border-color: color-mix(in srgb, var(--hb-ki3-accent) 60%, transparent); color: var(--hb-ki3-accent); }\n.hb-ki3-tip {\n  position: absolute;\n  bottom: calc(100% + 8px);\n  left: 50%;\n  padding: 4px 8px;\n  border-radius: 6px;\n  background: #ededed;\n  color: #0a0a0a;\n  font-size: 11.5px;\n  font-weight: 600;\n  white-space: nowrap;\n  transform: translateX(-50%);\n  pointer-events: none;\n  animation: hb-ki3-tip .25s ease both;\n}\n.hb-ki3-status {\n  display: flex;\n  align-items: center;\n  gap: 12px;\n  margin: 22px 0 30px;\n  color: #8f8f8f;\n  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);\n  font-size: 12px;\n}\n.hb-ki3-track {\n  position: relative;\n  flex: 1;\n  height: 2px;\n  border-radius: 2px;\n  background: rgba(255,255,255,.08);\n  overflow: hidden;\n}\n.hb-ki3-track span {\n  position: absolute;\n  inset: 0;\n  background: var(--hb-ki3-accent);\n  transform: scaleX(var(--hb-ki3-p, 0));\n  transform-origin: left;\n  transition: transform .5s cubic-bezier(.2,.7,.2,1);\n  animation: hb-ki3-fill 1.4s cubic-bezier(.2,.7,.2,1) both;\n}\n.hb-ki3-body p {\n  margin: 0 0 20px;\n  color: #c9c9c9;\n  font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);\n  font-size: clamp(19px, 2.3cqi, 22px);\n  line-height: 1.6;\n  text-wrap: pretty;\n}\n.hb-ki3-body p:first-child { color: #ededed; }\n.hb-ki3-body p:first-child::first-letter {\n  float: left;\n  margin: .06em .12em 0 0;\n  color: var(--hb-ki3-accent);\n  font-size: 4.3em;\n  line-height: .78;\n  font-weight: 400;\n  text-shadow: 0 0 28px color-mix(in srgb, var(--hb-ki3-accent) 45%, transparent);\n}\n@container (max-width: 520px) {\n  .hb-ki3-byline { align-items: flex-start; }\n  .hb-ki3-share { width: 100%; }\n}\n@keyframes hb-ki3-fill { from { transform: scaleX(0); } }\n@keyframes hb-ki3-word {\n  from { opacity: 0; transform: translateY(.35em); filter: blur(6px); }\n  to { opacity: 1; transform: none; filter: blur(0); }\n}\n@keyframes hb-ki3-tip {\n  from { opacity: 0; transform: translate(-50%, 4px); }\n  to { opacity: 1; transform: translate(-50%, 0); }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-ki3-fill, .hb-ki3-track span, .hb-ki3-word, .hb-ki3-dek, .hb-ki3-tip { animation: none; }\n  .hb-ki3-fill, .hb-ki3-track span, .hb-ki3-sbtn, .hb-ki3-crumbs a { transition: none; }\n}\n`;\n\nfunction Chevron() {\n  return (\n    <svg viewBox=\"0 0 12 12\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n      <path d=\"M4.5 2.5 8 6l-3.5 3.5\" />\n    </svg>\n  );\n}\n\nfunction initials(name: string) {\n  return name\n    .split(/\\s+/)\n    .filter(Boolean)\n    .slice(0, 2)\n    .map((part) => part[0]?.toUpperCase() ?? \"\")\n    .join(\"\");\n}\n\nconst defaultBody = [\n  \"Every product team has a number they quietly avoid. For us it was p99 latency on the dashboard, a figure that hovered around 2.4 seconds for most of last year while the median looked perfectly healthy. Users did not complain about the median. They complained about Monday mornings.\",\n  \"This is the story of how we gave every request a budget, made that budget visible in code review, and brought the slowest one percent of page loads under 600 milliseconds without a rewrite.\",\n];\n\nexport function BlogArticleHeader({\n  breadcrumbs = [\n    { label: \"Journal\", href: \"#\" },\n    { label: \"Engineering\", href: \"#\" },\n    { label: \"Latency budgets\", href: \"#\" },\n  ],\n  category = \"Engineering\",\n  title = \"Latency budgets: how we made the slowest page load fast\",\n  dek = \"A practical system for giving every request a time limit, catching regressions in review and keeping p99 honest as the product grows.\",\n  author = { name: \"Priya Raman\", role: \"Staff engineer, Platform\" },\n  date = \"Oct 28, 2026\",\n  readTime = \"12 min read\",\n  updated,\n  progress = 34,\n  intro,\n  body = defaultBody,\n  shareUrl = \"https://northwind.example/journal/latency-budgets\",\n  onShare,\n  accent = \"#22d3ee\",\n  className,\n  style,\n  ...rest\n}: BlogArticleHeaderProps) {\n  const [copied, setCopied] = React.useState(false);\n  const timer = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n  const clamped = Math.min(100, Math.max(0, progress));\n  const paragraphs = intro ? [intro, ...body] : body;\n  const minutes = parseInt(readTime, 10);\n  const left = Number.isFinite(minutes) ? Math.max(0, Math.ceil(minutes * (1 - clamped / 100))) : null;\n\n  React.useEffect(() => () => {\n    if (timer.current) clearTimeout(timer.current);\n  }, []);\n\n  const copy = () => {\n    onShare?.(\"copy\");\n    const finish = () => {\n      setCopied(true);\n      if (timer.current) clearTimeout(timer.current);\n      timer.current = setTimeout(() => setCopied(false), 1800);\n    };\n    if (typeof navigator !== \"undefined\" && navigator.clipboard) navigator.clipboard.writeText(shareUrl).then(finish, finish);\n    else finish();\n  };\n\n  const encoded = encodeURIComponent(shareUrl);\n  const encodedTitle = encodeURIComponent(title);\n  const words = title.split(\" \");\n\n  return (\n    <section\n      className={className ? `hb-ki3 ${className}` : \"hb-ki3\"}\n      style={{ \"--hb-ki3-accent\": accent, \"--hb-ki3-p\": (clamped / 100).toFixed(4), ...style } as React.CSSProperties}\n      {...rest}\n    >\n      <style href=\"hb-blog-article-header\" precedence=\"default\">{css}</style>\n      <div\n        className=\"hb-ki3-progress\"\n        role=\"progressbar\"\n        aria-label=\"Reading progress\"\n        aria-valuemin={0}\n        aria-valuemax={100}\n        aria-valuenow={Math.round(clamped)}\n      >\n        <div className=\"hb-ki3-fill\" />\n      </div>\n      <div className=\"hb-ki3-inner\">\n        <div className=\"hb-ki3-col\">\n          {breadcrumbs.length > 0 && (\n            <nav className=\"hb-ki3-crumbs\" aria-label=\"Breadcrumb\">\n              <ol>\n                {breadcrumbs.map((crumb, i) => {\n                  const last = i === breadcrumbs.length - 1;\n                  return (\n                    <li key={`${crumb.label}-${i}`} aria-current={last ? \"page\" : undefined}>\n                      {last ? crumb.label : <a href={crumb.href}>{crumb.label}</a>}\n                      {!last && <Chevron />}\n                    </li>\n                  );\n                })}\n              </ol>\n            </nav>\n          )}\n          {category && <span className=\"hb-ki3-cat\">{category}</span>}\n          <h1 className=\"hb-ki3-title\">\n            {words.map((word, i) => (\n              <React.Fragment key={`${word}-${i}`}>\n                <span className=\"hb-ki3-word\" style={{ \"--hb-ki3-d\": `${(i * 45).toFixed(0)}ms` } as React.CSSProperties}>\n                  {word}\n                </span>\n                {i < words.length - 1 ? \" \" : \"\"}\n              </React.Fragment>\n            ))}\n          </h1>\n          {dek && <p className=\"hb-ki3-dek\">{dek}</p>}\n          <div className=\"hb-ki3-byline\">\n            <div className=\"hb-ki3-author\">\n              <span className=\"hb-ki3-avatar\" aria-hidden=\"true\">{initials(author.name)}</span>\n              <div className=\"hb-ki3-who\">\n                <span className=\"hb-ki3-name\">\n                  {author.name}\n                  {author.role && <span style={{ color: \"#8f8f8f\", fontWeight: 400 }}> · {author.role}</span>}\n                </span>\n                <div className=\"hb-ki3-meta\">\n                  <span>\n                    <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.4\" aria-hidden=\"true\">\n                      <rect x=\"2.5\" y=\"3.5\" width=\"11\" height=\"10\" rx=\"2\" />\n                      <path d=\"M2.5 6.5h11M5.5 2v3M10.5 2v3\" strokeLinecap=\"round\" />\n                    </svg>\n                    {date}\n                  </span>\n                  <span>\n                    <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.4\" aria-hidden=\"true\">\n                      <circle cx=\"8\" cy=\"8\" r=\"5.5\" />\n                      <path d=\"M8 5v3l2 1.5\" strokeLinecap=\"round\" />\n                    </svg>\n                    {readTime}\n                  </span>\n                  {updated && <span>Updated {updated}</span>}\n                </div>\n              </div>\n            </div>\n            <div className=\"hb-ki3-share\" aria-label=\"Share this article\" role=\"group\">\n              <a\n                className=\"hb-ki3-sbtn\"\n                href={`https://x.com/intent/post?url=${encoded}&text=${encodedTitle}`}\n                target=\"_blank\"\n                rel=\"noreferrer\"\n                aria-label=\"Share on X\"\n                onClick={() => onShare?.(\"x\")}\n              >\n                <svg viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\">\n                  <path d=\"M12.2 1.5h2.2L9.6 7l5.6 7.5h-4.4L7.4 10l-3.9 4.5H1.3l5.1-5.9L1 1.5h4.5l3.1 4.1 3.6-4.1Zm-.8 11.7h1.2L4.7 2.7H3.4l8 10.5Z\" />\n                </svg>\n              </a>\n              <a\n                className=\"hb-ki3-sbtn\"\n                href={`https://www.linkedin.com/sharing/share-offsite/?url=${encoded}`}\n                target=\"_blank\"\n                rel=\"noreferrer\"\n                aria-label=\"Share on LinkedIn\"\n                onClick={() => onShare?.(\"linkedin\")}\n              >\n                <svg viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\">\n                  <path d=\"M3.6 5.6H1.2V15h2.4V5.6ZM2.4 1.2a1.4 1.4 0 1 0 0 2.8 1.4 1.4 0 0 0 0-2.8ZM15 9.8c0-2.6-.6-4.4-3.4-4.4-1.4 0-2.3.7-2.7 1.4V5.6H6.6V15H9v-4.7c0-1.2.2-2.4 1.8-2.4 1.5 0 1.6 1.4 1.6 2.5V15H15V9.8Z\" />\n                </svg>\n              </a>\n              <button\n                type=\"button\"\n                className=\"hb-ki3-sbtn\"\n                aria-label={copied ? \"Link copied\" : \"Copy link\"}\n                data-done={copied}\n                onClick={copy}\n              >\n                {copied ? (\n                  <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n                    <path d=\"m3.5 8.5 3 3 6-7\" />\n                  </svg>\n                ) : (\n                  <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n                    <path d=\"M6.8 9.2a3 3 0 0 0 4.2 0l2.1-2.1a3 3 0 0 0-4.2-4.2l-.8.8\" />\n                    <path d=\"M9.2 6.8a3 3 0 0 0-4.2 0L2.9 8.9a3 3 0 0 0 4.2 4.2l.8-.8\" />\n                  </svg>\n                )}\n                {copied && <span className=\"hb-ki3-tip\" aria-hidden=\"true\">Copied</span>}\n              </button>\n            </div>\n          </div>\n          <div className=\"hb-ki3-status\" aria-hidden=\"true\">\n            <span>{Math.round(clamped)}% read</span>\n            <span className=\"hb-ki3-track\"><span /></span>\n            {left !== null && <span>{left} min left</span>}\n          </div>\n          <div className=\"hb-ki3-body\">\n            {paragraphs.map((text, i) => (\n              <p key={i}>{text}</p>\n            ))}\n          </div>\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}