{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "blog-category-tiles",
  "type": "registry:component",
  "title": "Blog Category Tiles",
  "description": "A light blog index with six topic tiles, each with its own color, floating shape and post count, followed by a dark featured post strip with a zooming cover.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "blog",
    "blog",
    "categories",
    "topics",
    "featured",
    "tiles",
    "light"
  ],
  "docs": "https://hyperblur.dev/effects/blog-category-tiles",
  "files": [
    {
      "path": "registry/hyperblur/blog-category-tiles.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/blog-category-tiles.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface BlogCategoryTile {\n  name: string;\n  count: number;\n  description: string;\n  href: string;\n  colors?: [string, string];\n  shape?: \"circle\" | \"arc\" | \"stack\" | \"wave\" | \"grid\" | \"spark\";\n}\n\nexport interface BlogFeaturedStripPost {\n  label: string;\n  title: string;\n  excerpt: string;\n  author: string;\n  role: string;\n  date: string;\n  readTime: string;\n  href: string;\n  cover?: string;\n}\n\nexport interface BlogCategoryTilesProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  categories?: BlogCategoryTile[];\n  featured?: BlogFeaturedStripPost | null;\n  accent?: string;\n  onCategoryClick?: (category: BlogCategoryTile, index: number) => void;\n}\n\nconst defaultCategories: BlogCategoryTile[] = [\n  { name: \"Engineering\", count: 84, description: \"Architecture notes and postmortems\", href: \"#\", colors: [\"#2f7bff\", \"#7fb3ff\"], shape: \"grid\" },\n  { name: \"Design\", count: 52, description: \"Interfaces, type and motion\", href: \"#\", colors: [\"#ec4899\", \"#fbcfe8\"], shape: \"circle\" },\n  { name: \"Product\", count: 47, description: \"Roadmaps, launches and lessons\", href: \"#\", colors: [\"#f59e0b\", \"#fde68a\"], shape: \"stack\" },\n  { name: \"Culture\", count: 29, description: \"How we hire, work and rest\", href: \"#\", colors: [\"#10b981\", \"#a7f3d0\"], shape: \"wave\" },\n  { name: \"Customer stories\", count: 36, description: \"Teams building with Lattice\", href: \"#\", colors: [\"#8b5cf6\", \"#ddd6fe\"], shape: \"arc\" },\n  { name: \"Changelog\", count: 118, description: \"Every release, explained\", href: \"#\", colors: [\"#ef4444\", \"#fecaca\"], shape: \"spark\" },\n];\n\nconst defaultFeatured: BlogFeaturedStripPost = {\n  label: \"Featured essay\",\n  title: \"We rewrote our sync engine in eleven weeks. Here is every mistake.\",\n  excerpt: \"A candid look at moving 2.3 billion records to a new replication model without a single minute of planned downtime.\",\n  author: \"Renata Silva\",\n  role: \"Staff Engineer\",\n  date: \"Oct 29, 2026\",\n  readTime: \"14 min read\",\n  href: \"#\",\n};\n\nconst css = `\n.hb-yj8 {\n  --hb-yj8-accent: #2f7bff;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  overflow: hidden;\n  isolation: isolate;\n  container-type: inline-size;\n  background: #ffffff;\n  color: #0f0f10;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-yj8 *, .hb-yj8 *::before, .hb-yj8 *::after { box-sizing: border-box; }\n.hb-yj8-inner { max-width: 1120px; margin: 0 auto; padding: 72px 20px; }\n@container (min-width: 800px) { .hb-yj8-inner { padding: 100px 32px; } }\n.hb-yj8-head {\n  display: grid;\n  gap: 14px 48px;\n  margin-bottom: 40px;\n}\n@container (min-width: 800px) { .hb-yj8-head { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); align-items: end; } }\n.hb-yj8-eyebrow { margin: 0 0 12px; color: var(--hb-yj8-accent); font-size: 13px; font-weight: 600; }\n.hb-yj8-title { margin: 0; font-size: clamp(30px, 4.6cqw, 46px); line-height: 1.05; letter-spacing: -.035em; font-weight: 650; text-wrap: balance; }\n.hb-yj8-sub { margin: 0; color: #5f5f66; font-size: 16px; line-height: 1.6; }\n.hb-yj8-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }\n@container (min-width: 800px) { .hb-yj8-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }\n.hb-yj8-tile {\n  position: relative;\n  display: flex;\n  flex-direction: column;\n  justify-content: flex-end;\n  min-height: 172px;\n  padding: 18px;\n  overflow: hidden;\n  border: 1px solid rgba(15, 15, 16, .08);\n  border-radius: 18px;\n  background: #fafafa;\n  color: inherit;\n  text-decoration: none;\n  opacity: 0;\n  transform: translateY(16px);\n  transition: border-color .3s ease, box-shadow .3s ease, transform .5s cubic-bezier(.2, .8, .2, 1);\n}\n@container (min-width: 800px) { .hb-yj8-tile { min-height: 196px; padding: 22px; } }\n.hb-yj8-seen .hb-yj8-tile { animation: hb-yj8-rise .7s cubic-bezier(.2, .8, .2, 1) forwards; animation-delay: calc(var(--hb-yj8-i) * 70ms); }\n.hb-yj8-tile:hover { border-color: rgba(15, 15, 16, .16); box-shadow: 0 20px 40px -24px rgba(15, 15, 16, .35); }\n.hb-yj8-tile:focus-visible { outline: 2px solid var(--hb-yj8-accent); outline-offset: 3px; }\n.hb-yj8-art {\n  position: absolute;\n  inset: 0;\n  z-index: 0;\n  background:\n    radial-gradient(70% 90% at 100% 0%, var(--hb-yj8-c2), transparent 70%),\n    linear-gradient(180deg, transparent 40%, #fafafa 88%);\n  opacity: .85;\n  transition: opacity .4s ease;\n}\n.hb-yj8-tile:hover .hb-yj8-art { opacity: 1; }\n.hb-yj8-shape {\n  position: absolute;\n  top: 14px;\n  right: 14px;\n  width: 44%;\n  max-width: 120px;\n  aspect-ratio: 1;\n  color: var(--hb-yj8-c1);\n  transition: transform .6s cubic-bezier(.2, .8, .2, 1);\n}\n.hb-yj8-shape svg { width: 100%; height: 100%; overflow: visible; }\n.hb-yj8-tile:hover .hb-yj8-shape { transform: translate(-8px, 6px) rotate(-8deg) scale(1.08); }\n.hb-yj8-shape .hb-yj8-float { animation: hb-yj8-float 5s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }\n.hb-yj8-body { position: relative; z-index: 1; }\n.hb-yj8-count {\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n  margin-bottom: 10px;\n  padding: 3px 9px;\n  border-radius: 999px;\n  background: #fff;\n  border: 1px solid rgba(15, 15, 16, .08);\n  color: #3f3f46;\n  font-size: 12px;\n  font-weight: 600;\n  font-variant-numeric: tabular-nums;\n}\n.hb-yj8-count i { width: 6px; height: 6px; border-radius: 50%; background: var(--hb-yj8-c1); }\n.hb-yj8-name { display: flex; width: fit-content; align-items: center; gap: 8px; font-size: 18px; font-weight: 640; letter-spacing: -.02em; }\n.hb-yj8-name svg { opacity: 0; transform: translateX(-6px); transition: opacity .3s ease, transform .3s ease; }\n.hb-yj8-tile:hover .hb-yj8-name svg, .hb-yj8-tile:focus-visible .hb-yj8-name svg { opacity: 1; transform: none; }\n.hb-yj8-desc { display: block; margin: 4px 0 0; color: #6b6b73; font-size: 13.5px; line-height: 1.45; }\n@container (max-width: 480px) { .hb-yj8-desc { display: none; } .hb-yj8-name { font-size: 16px; } }\n.hb-yj8-feat {\n  display: grid;\n  margin-top: 14px;\n  overflow: hidden;\n  border: 1px solid rgba(15, 15, 16, .08);\n  border-radius: 22px;\n  background: #0f0f10;\n  color: #f4f4f5;\n  text-decoration: none;\n  transition: box-shadow .3s ease, transform .4s cubic-bezier(.2, .8, .2, 1);\n}\n.hb-yj8-feat:hover { box-shadow: 0 30px 60px -30px rgba(15, 15, 16, .55); transform: translateY(-2px); }\n.hb-yj8-feat:focus-visible { outline: 2px solid var(--hb-yj8-accent); outline-offset: 3px; }\n@container (min-width: 720px) { .hb-yj8-feat { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); } }\n.hb-yj8-cover {\n  position: relative;\n  min-height: 190px;\n  overflow: hidden;\n}\n.hb-yj8-cover-img {\n  position: absolute;\n  inset: 0;\n  transition: transform .8s cubic-bezier(.2, .8, .2, 1);\n}\n.hb-yj8-feat:hover .hb-yj8-cover-img { transform: scale(1.06); }\n.hb-yj8-cover svg { position: absolute; inset: 0; width: 100%; height: 100%; }\n.hb-yj8-fbody { display: flex; flex-direction: column; gap: 12px; padding: 26px; }\n@container (min-width: 720px) { .hb-yj8-fbody { padding: 32px 36px; } }\n.hb-yj8-label {\n  align-self: flex-start;\n  display: inline-flex;\n  align-items: center;\n  gap: 7px;\n  padding: 4px 10px;\n  border-radius: 999px;\n  background: color-mix(in srgb, var(--hb-yj8-accent) 22%, transparent);\n  color: color-mix(in srgb, var(--hb-yj8-accent) 50%, #fff);\n  font-size: 12px;\n  font-weight: 600;\n}\n.hb-yj8-ftitle { margin: 0; font-size: clamp(20px, 2.6cqw, 27px); line-height: 1.2; letter-spacing: -.025em; font-weight: 640; text-wrap: balance; }\n.hb-yj8-fex { margin: 0; color: #a1a1aa; font-size: 15px; line-height: 1.6; }\n.hb-yj8-by { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 6px; color: #a1a1aa; font-size: 13px; }\n.hb-yj8-av {\n  display: grid;\n  place-items: center;\n  width: 34px;\n  height: 34px;\n  border-radius: 50%;\n  background: linear-gradient(135deg, var(--hb-yj8-accent), #7fb3ff);\n  color: #0f0f10;\n  font-size: 12px;\n  font-weight: 700;\n}\n.hb-yj8-by strong { display: block; color: #f4f4f5; font-weight: 600; }\n.hb-yj8-read { margin-left: auto; white-space: nowrap; }\n@keyframes hb-yj8-rise { to { opacity: 1; transform: none; } }\n@keyframes hb-yj8-float { 50% { transform: translateY(-6%) rotate(6deg); } }\n@media (prefers-reduced-motion: reduce) {\n  .hb-yj8 *, .hb-yj8 *::before, .hb-yj8 *::after { animation: none !important; transition: none !important; }\n  .hb-yj8-tile { opacity: 1; transform: none; }\n}\n`;\n\nfunction Shape({ kind }: { kind: NonNullable<BlogCategoryTile[\"shape\"]> }) {\n  return (\n    <svg viewBox=\"0 0 100 100\" aria-hidden=\"true\">\n      {kind === \"circle\" ? (\n        <>\n          <circle cx=\"58\" cy=\"42\" r=\"34\" fill=\"currentColor\" opacity=\".9\" />\n          <circle className=\"hb-yj8-float\" cx=\"30\" cy=\"70\" r=\"16\" fill=\"#fff\" opacity=\".85\" />\n        </>\n      ) : null}\n      {kind === \"grid\" ? (\n        <>\n          {[0, 1, 2].flatMap((r) =>\n            [0, 1, 2].map((c) => <rect key={`${r}${c}`} x={12 + c * 28} y={12 + r * 28} width=\"22\" height=\"22\" rx=\"6\" fill=\"currentColor\" opacity={((r + c) % 3 === 0 ? 0.95 : 0.35).toFixed(2)} />),\n          )}\n          <rect className=\"hb-yj8-float\" x=\"40\" y=\"40\" width=\"22\" height=\"22\" rx=\"6\" fill=\"#fff\" />\n        </>\n      ) : null}\n      {kind === \"stack\" ? (\n        <>\n          <rect x=\"14\" y=\"58\" width=\"72\" height=\"22\" rx=\"8\" fill=\"currentColor\" opacity=\".35\" />\n          <rect x=\"20\" y=\"36\" width=\"60\" height=\"22\" rx=\"8\" fill=\"currentColor\" opacity=\".65\" />\n          <rect className=\"hb-yj8-float\" x=\"26\" y=\"14\" width=\"48\" height=\"22\" rx=\"8\" fill=\"currentColor\" />\n        </>\n      ) : null}\n      {kind === \"wave\" ? (\n        <>\n          <path d=\"M6 40c15-14 29-14 44 0s29 14 44 0\" stroke=\"currentColor\" strokeWidth=\"10\" strokeLinecap=\"round\" fill=\"none\" />\n          <path d=\"M6 66c15-14 29-14 44 0s29 14 44 0\" stroke=\"currentColor\" strokeWidth=\"10\" strokeLinecap=\"round\" fill=\"none\" opacity=\".4\" />\n          <circle className=\"hb-yj8-float\" cx=\"74\" cy=\"20\" r=\"9\" fill=\"#fff\" />\n        </>\n      ) : null}\n      {kind === \"arc\" ? (\n        <>\n          <path d=\"M14 86a72 72 0 0 1 72-72v72Z\" fill=\"currentColor\" opacity=\".9\" />\n          <circle className=\"hb-yj8-float\" cx=\"66\" cy=\"62\" r=\"13\" fill=\"#fff\" />\n        </>\n      ) : null}\n      {kind === \"spark\" ? (\n        <>\n          <path className=\"hb-yj8-float\" d=\"M50 6c4 26 18 40 44 44-26 4-40 18-44 44-4-26-18-40-44-44 26-4 40-18 44-44Z\" fill=\"currentColor\" />\n          <circle cx=\"82\" cy=\"18\" r=\"7\" fill=\"currentColor\" opacity=\".4\" />\n        </>\n      ) : null}\n    </svg>\n  );\n}\n\nfunction initials(name: string) {\n  return name\n    .split(\" \")\n    .map((p) => p[0])\n    .join(\"\")\n    .slice(0, 2)\n    .toUpperCase();\n}\n\nexport function BlogCategoryTiles({\n  eyebrow = \"The Lattice blog\",\n  title = \"Browse by topic\",\n  subtitle = \"Three hundred and sixty six posts from the people building Lattice, sorted into the shelves our readers use most.\",\n  categories = defaultCategories,\n  featured = defaultFeatured,\n  accent = \"#2f7bff\",\n  onCategoryClick,\n  className,\n  style,\n  ...rest\n}: BlogCategoryTilesProps) {\n  const [seen, setSeen] = React.useState(false);\n  const gridRef = React.useRef<HTMLDivElement>(null);\n\n  React.useEffect(() => {\n    const el = gridRef.current;\n    if (!el) return;\n    const io = new IntersectionObserver(\n      (entries) => {\n        if (entries.some((e) => e.isIntersecting)) {\n          setSeen(true);\n          io.disconnect();\n        }\n      },\n      { threshold: 0.1 },\n    );\n    io.observe(el);\n    return () => io.disconnect();\n  }, []);\n\n  return (\n    <section\n      className={[\"hb-yj8\", seen ? \"hb-yj8-seen\" : \"\", className].filter(Boolean).join(\" \")}\n      style={{ \"--hb-yj8-accent\": accent, ...style } as React.CSSProperties}\n      {...rest}\n    >\n      <style href=\"hb-blog-category-tiles\" precedence=\"default\">{css}</style>\n      <div className=\"hb-yj8-inner\">\n        <div className=\"hb-yj8-head\">\n          <div>\n            {eyebrow ? <p className=\"hb-yj8-eyebrow\">{eyebrow}</p> : null}\n            <h2 className=\"hb-yj8-title\">{title}</h2>\n          </div>\n          {subtitle ? <p className=\"hb-yj8-sub\">{subtitle}</p> : null}\n        </div>\n        <div className=\"hb-yj8-grid\" ref={gridRef}>\n          {categories.map((c, i) => {\n            const [c1, c2] = c.colors ?? [accent, \"#e4e4e7\"];\n            return (\n              <a\n                key={c.name}\n                className=\"hb-yj8-tile\"\n                href={c.href}\n                onClick={() => onCategoryClick?.(c, i)}\n                style={{ \"--hb-yj8-i\": i, \"--hb-yj8-c1\": c1, \"--hb-yj8-c2\": c2 } as React.CSSProperties}\n              >\n                <span className=\"hb-yj8-art\" aria-hidden=\"true\" />\n                <span className=\"hb-yj8-shape\">\n                  <Shape kind={c.shape ?? \"circle\"} />\n                </span>\n                <span className=\"hb-yj8-body\">\n                  <span className=\"hb-yj8-count\">\n                    <i />\n                    {c.count} posts\n                  </span>\n                  <span className=\"hb-yj8-name\">\n                    {c.name}\n                    <svg width=\"14\" height=\"14\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n                      <path d=\"M3 8h10m-4-4 4 4-4 4\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n                    </svg>\n                  </span>\n                  <span className=\"hb-yj8-desc\">\n                    {c.description}\n                  </span>\n                </span>\n              </a>\n            );\n          })}\n        </div>\n        {featured ? (\n          <a className=\"hb-yj8-feat\" href={featured.href}>\n            <div className=\"hb-yj8-cover\">\n              <div\n                className=\"hb-yj8-cover-img\"\n                style={{\n                  background:\n                    featured.cover ??\n                    `radial-gradient(60% 80% at 30% 30%, ${accent}, transparent 70%), radial-gradient(50% 60% at 80% 80%, #ec4899, transparent 70%), linear-gradient(135deg, #1e1b4b, #0f0f10)`,\n                }}\n              >\n                {featured.cover ? null : (\n                  <svg viewBox=\"0 0 400 240\" preserveAspectRatio=\"xMidYMid slice\" aria-hidden=\"true\">\n                    {[0, 1, 2, 3, 4, 5, 6].map((i) => (\n                      <path key={i} d={`M-20 ${(150 + i * 14).toFixed(0)} C 100 ${(90 + i * 18).toFixed(0)}, 260 ${(210 - i * 6).toFixed(0)}, 420 ${(120 + i * 12).toFixed(0)}`} stroke=\"#fff\" strokeOpacity={(0.08 + i * 0.04).toFixed(2)} strokeWidth=\"1.5\" fill=\"none\" />\n                    ))}\n                    <circle cx=\"300\" cy=\"70\" r=\"26\" fill=\"#fff\" fillOpacity=\".9\" />\n                  </svg>\n                )}\n              </div>\n            </div>\n            <div className=\"hb-yj8-fbody\">\n              <span className=\"hb-yj8-label\">{featured.label}</span>\n              <h3 className=\"hb-yj8-ftitle\">{featured.title}</h3>\n              <p className=\"hb-yj8-fex\">{featured.excerpt}</p>\n              <div className=\"hb-yj8-by\">\n                <span className=\"hb-yj8-av\">{initials(featured.author)}</span>\n                <span>\n                  <strong>{featured.author}</strong>\n                  {featured.role} · {featured.date}\n                </span>\n                <span className=\"hb-yj8-read\">{featured.readTime}</span>\n              </div>\n            </div>\n          </a>\n        ) : null}\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}