{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "nav-tab-bar",
  "type": "registry:component",
  "title": "Nav Tab Bar",
  "description": "A mobile bottom tab bar with a glowing blob that springs and squashes to the active tab, count and dot badges, and arrow key support. The preview shows it inside a phone whose screens slide with the selection.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "navigation",
    "tab bar",
    "mobile",
    "bottom navigation",
    "badges",
    "spring",
    "navigation"
  ],
  "docs": "https://hyperblur.dev/effects/nav-tab-bar",
  "files": [
    {
      "path": "registry/hyperblur/nav-tab-bar.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/nav-tab-bar.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport type NavTabBarIcon = \"home\" | \"explore\" | \"inbox\" | \"activity\" | \"profile\" | \"plus\" | \"calendar\" | \"bag\";\n\nexport interface NavTabBarTab {\n  label: string;\n  icon: NavTabBarIcon;\n  badge?: number | boolean;\n  href?: string;\n}\n\nexport interface NavTabBarProps extends Omit<React.HTMLAttributes<HTMLElement>, \"defaultValue\" | \"onChange\"> {\n  tabs?: NavTabBarTab[];\n  value?: number;\n  defaultValue?: number;\n  onValueChange?: (index: number, tab: NavTabBarTab) => void;\n  showLabels?: boolean;\n  accent?: string;\n  showBackdrop?: boolean;\n}\n\nconst css = `\n.hb-yh4 {\n  --hb-yh4-accent: #22d3ee;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  container-type: inline-size;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-yh4 *, .hb-yh4 *::before, .hb-yh4 *::after { box-sizing: border-box; }\n.hb-yh4[data-backdrop=\"true\"] {\n  display: flex;\n  justify-content: center;\n  overflow: hidden;\n  padding: 36px 16px 48px;\n  background:\n    radial-gradient(40% 50% at 50% 40%, color-mix(in srgb, var(--hb-yh4-accent) 18%, transparent), transparent 70%),\n    radial-gradient(30% 40% at 18% 80%, rgba(139,92,246,.14), transparent 70%),\n    #0a0a0a;\n}\n.hb-yh4[data-backdrop=\"true\"]::before {\n  content: \"\";\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: 48px 48px;\n  -webkit-mask-image: radial-gradient(60% 60% at 50% 50%, #000, transparent);\n  mask-image: radial-gradient(60% 60% at 50% 50%, #000, transparent);\n  pointer-events: none;\n}\n.hb-yh4-side { position: absolute; top: 50%; width: 220px; padding: 14px 16px; border: 1px solid rgba(255,255,255,.08); border-radius: 16px; background: rgba(20,20,22,.7); backdrop-filter: blur(10px); box-shadow: 0 20px 50px -20px rgba(0,0,0,.8); }\n.hb-yh4-side[data-at=\"l\"] { right: calc(50% + 196px); transform: translateY(-80%); animation: hb-yh4-float 6s ease-in-out infinite; }\n.hb-yh4-side[data-at=\"r\"] { left: calc(50% + 196px); transform: translateY(10%); animation: hb-yh4-float 7s ease-in-out -2s infinite; }\n.hb-yh4-sk { color: #8f8f8f; font-size: 11.5px; }\n.hb-yh4-sv { margin-top: 4px; font-size: 22px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }\n.hb-yh4-sv em { margin-left: 6px; color: var(--hb-yh4-accent); font-size: 12px; font-style: normal; font-weight: 600; }\n.hb-yh4-spark { display: flex; align-items: flex-end; gap: 4px; height: 34px; margin-top: 10px; }\n.hb-yh4-spark i { flex: 1; border-radius: 3px; background: rgba(255,255,255,.12); }\n.hb-yh4-spark i:last-child { background: var(--hb-yh4-accent); }\n.hb-yh4-phone {\n  position: relative;\n  z-index: 1;\n  width: 300px;\n  height: 600px;\n  padding: 10px;\n  border-radius: 52px;\n  background: linear-gradient(145deg, #2b2b2e, #121214 40%, #1d1d20);\n  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), inset 0 0 0 3px #08080a, 0 40px 90px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(0,0,0,.6);\n}\n.hb-yh4-screen { position: relative; display: flex; flex-direction: column; height: 100%; overflow: hidden; border-radius: 42px; background: linear-gradient(180deg, #101012, #0a0a0b); }\n.hb-yh4-island { position: absolute; z-index: 3; top: 10px; left: 50%; width: 92px; height: 26px; border-radius: 99px; background: #000; transform: translateX(-50%); }\n.hb-yh4-status { display: flex; justify-content: space-between; align-items: center; height: 46px; padding: 6px 28px 0; font-size: 13px; font-weight: 600; }\n.hb-yh4-status svg { width: 38px; height: 12px; fill: #ededed; }\n.hb-yh4-view { position: relative; flex: 1; overflow: hidden; }\n.hb-yh4-track { display: flex; height: 100%; transition: transform .55s cubic-bezier(.3,1,.35,1); transform: translateX(calc(var(--hb-yh4-i) * -100%)); }\n.hb-yh4-page { flex: none; width: 100%; height: 100%; padding: 8px 18px 0; }\n.hb-yh4-h { margin: 6px 0 14px; font-size: 26px; font-weight: 700; letter-spacing: -.03em; }\n.hb-yh4-hero { position: relative; height: 150px; padding: 16px; border-radius: 22px; background: linear-gradient(135deg, color-mix(in srgb, var(--hb-yh4-accent) 70%, #0a0a0a), #1e1b4b); overflow: hidden; }\n.hb-yh4-hero::after { content: \"\"; position: absolute; right: -30px; bottom: -40px; width: 150px; height: 150px; border-radius: 50%; border: 18px solid rgba(255,255,255,.14); }\n.hb-yh4-hk { color: rgba(255,255,255,.75); font-size: 11.5px; font-weight: 600; }\n.hb-yh4-hv { margin-top: 6px; font-size: 34px; font-weight: 700; letter-spacing: -.04em; }\n.hb-yh4-hs { margin-top: 2px; color: rgba(255,255,255,.75); font-size: 12px; }\n.hb-yh4-rows { display: grid; gap: 8px; margin-top: 12px; }\n.hb-yh4-r { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: #161618; }\n.hb-yh4-av { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; color: #fff; font-size: 11.5px; font-weight: 700; }\n.hb-yh4-rt { min-width: 0; flex: 1; }\n.hb-yh4-rn { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.hb-yh4-rd { display: block; margin-top: 2px; color: #8f8f8f; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.hb-yh4-rx { color: #8f8f8f; font-size: 11px; }\n.hb-yh4-rx b { display: block; width: 8px; height: 8px; margin: 4px 0 0 auto; border-radius: 50%; background: var(--hb-yh4-accent); }\n.hb-yh4-search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 14px; background: #19191b; color: #8f8f8f; font-size: 13px; }\n.hb-yh4-search svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }\n.hb-yh4-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }\n.hb-yh4-chip { height: 28px; padding: 0 12px; border-radius: 99px; background: #19191b; color: #c4c4c4; font-size: 12px; line-height: 28px; }\n.hb-yh4-chip:first-child { background: color-mix(in srgb, var(--hb-yh4-accent) 20%, transparent); color: var(--hb-yh4-accent); }\n.hb-yh4-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }\n.hb-yh4-tile { height: 96px; padding: 10px; border-radius: 18px; color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: flex-end; }\n.hb-yh4-ring { position: relative; width: 170px; height: 170px; margin: 4px auto 14px; }\n.hb-yh4-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }\n.hb-yh4-ring circle { fill: none; stroke-width: 14; stroke-linecap: round; }\n.hb-yh4-rc { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }\n.hb-yh4-rc b { font-size: 30px; letter-spacing: -.03em; }\n.hb-yh4-rc span { color: #8f8f8f; font-size: 11.5px; }\n.hb-yh4-me { display: grid; justify-items: center; padding-top: 12px; text-align: center; }\n.hb-yh4-big { width: 84px; height: 84px; border-radius: 50%; background: conic-gradient(from 200deg, var(--hb-yh4-accent), #8b5cf6, #f472b6, var(--hb-yh4-accent)); padding: 3px; }\n.hb-yh4-big span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: #1b1b1e; font-size: 26px; font-weight: 700; }\n.hb-yh4-mn { margin-top: 12px; font-size: 18px; font-weight: 700; }\n.hb-yh4-ms { margin-top: 2px; color: #8f8f8f; font-size: 12.5px; }\n.hb-yh4-stats { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; margin-top: 18px; padding: 12px 0; border-radius: 16px; background: #161618; }\n.hb-yh4-stats div { display: grid; gap: 2px; font-size: 16px; font-weight: 700; }\n.hb-yh4-stats span { color: #8f8f8f; font-size: 11px; font-weight: 500; }\n.hb-yh4-barwrap { position: relative; z-index: 2; padding: 0 12px 14px; }\n.hb-yh4[data-backdrop=\"false\"] .hb-yh4-barwrap { max-width: 480px; margin: 0 auto; padding: 12px; }\n.hb-yh4-bar {\n  position: relative;\n  display: grid;\n  grid-template-columns: repeat(var(--hb-yh4-n), minmax(0, 1fr));\n  height: 68px;\n  margin: 0;\n  padding: 0 6px;\n  border: 1px solid rgba(255,255,255,.08);\n  border-radius: 26px;\n  background: linear-gradient(180deg, rgba(32,32,36,.9), rgba(20,20,22,.92));\n  backdrop-filter: blur(18px) saturate(160%);\n  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 14px 34px -12px rgba(0,0,0,.8);\n  list-style: none;\n}\n.hb-yh4-blob {\n  position: absolute;\n  top: 9px;\n  left: 6px;\n  width: calc((100% - 12px) / var(--hb-yh4-n));\n  height: 50px;\n  pointer-events: none;\n  transform: translateX(calc(var(--hb-yh4-i) * 100%));\n  transition: transform .5s cubic-bezier(.34,1.45,.5,1);\n}\n.hb-yh4-blob::before {\n  content: \"\";\n  position: absolute;\n  inset: 0 6px;\n  border-radius: 18px;\n  background: radial-gradient(80% 90% at 50% 0%, color-mix(in srgb, var(--hb-yh4-accent) 42%, transparent), color-mix(in srgb, var(--hb-yh4-accent) 14%, transparent));\n  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 0 24px -4px color-mix(in srgb, var(--hb-yh4-accent) 60%, transparent);\n  animation: hb-yh4-squash .5s cubic-bezier(.3,1.3,.5,1);\n}\n.hb-yh4-blob[data-k=\"b\"]::before { animation-name: hb-yh4-squash2; }\n.hb-yh4-blob::after {\n  content: \"\";\n  position: absolute;\n  left: 50%;\n  bottom: -5px;\n  width: 4px;\n  height: 4px;\n  border-radius: 50%;\n  background: var(--hb-yh4-accent);\n  box-shadow: 0 0 8px var(--hb-yh4-accent);\n  transform: translateX(-50%);\n}\n.hb-yh4-li { position: relative; display: flex; }\n.hb-yh4-btn {\n  position: relative;\n  display: flex;\n  flex: 1;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  gap: 3px;\n  margin: 0;\n  padding: 0;\n  border: 0;\n  background: transparent;\n  color: #7a7a7a;\n  font: inherit;\n  font-size: 10.5px;\n  font-weight: 600;\n  text-decoration: none;\n  cursor: pointer;\n  -webkit-tap-highlight-color: transparent;\n  transition: color .25s ease;\n}\n.hb-yh4-btn:hover { color: #c4c4c4; }\n.hb-yh4-btn[aria-current=\"page\"] { color: #fff; }\n.hb-yh4-btn:focus-visible { outline: none; }\n.hb-yh4-btn:focus-visible .hb-yh4-ico { outline: 2px solid var(--hb-yh4-accent); outline-offset: 4px; border-radius: 8px; }\n.hb-yh4-ico { position: relative; display: grid; place-items: center; width: 24px; height: 24px; transition: transform .4s cubic-bezier(.34,1.56,.5,1); }\n.hb-yh4-btn[aria-current=\"page\"] .hb-yh4-ico { transform: translateY(-1px) scale(1.08); }\n.hb-yh4-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }\n.hb-yh4-btn[aria-current=\"page\"] .hb-yh4-ico svg { stroke-width: 2.1; }\n.hb-yh4-lab { white-space: nowrap; letter-spacing: .01em; }\n.hb-yh4-badge {\n  position: absolute;\n  top: -6px;\n  left: 14px;\n  min-width: 17px;\n  height: 17px;\n  padding: 0 5px;\n  border: 2px solid #18181b;\n  border-radius: 99px;\n  background: #f43f5e;\n  color: #fff;\n  font-size: 9.5px;\n  font-weight: 700;\n  line-height: 13px;\n  text-align: center;\n  animation: hb-yh4-pop .5s cubic-bezier(.34,1.8,.5,1) .4s both;\n}\n.hb-yh4-badge[data-dot=\"true\"] { top: -2px; left: 16px; min-width: 0; width: 11px; height: 11px; padding: 0; }\n.hb-yh4-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n@keyframes hb-yh4-squash { 0% { transform: scale(1.35, .78); } 55% { transform: scale(.92, 1.08); } 100% { transform: none; } }\n@keyframes hb-yh4-squash2 { 0% { transform: scale(1.35, .78); } 55% { transform: scale(.92, 1.08); } 100% { transform: none; } }\n@keyframes hb-yh4-pop { from { transform: scale(0); } to { transform: scale(1); } }\n@keyframes hb-yh4-float { 50% { margin-top: -10px; } }\n@container (max-width: 820px) {\n  .hb-yh4-side { display: none; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-yh4 *, .hb-yh4 *::before, .hb-yh4 *::after { animation: none !important; transition: none !important; }\n}\n`;\n\nconst defaultTabs: NavTabBarTab[] = [\n  { label: \"Home\", icon: \"home\" },\n  { label: \"Explore\", icon: \"explore\" },\n  { label: \"Inbox\", icon: \"inbox\", badge: 3 },\n  { label: \"Activity\", icon: \"activity\", badge: true },\n  { label: \"Profile\", icon: \"profile\" },\n];\n\nconst paths: Record<NavTabBarIcon, React.ReactNode> = {\n  home: (\n    <>\n      <path d=\"M4 10.5 12 4l8 6.5V19a1 1 0 0 1-1 1h-4.5v-5.5h-5V20H5a1 1 0 0 1-1-1z\" />\n    </>\n  ),\n  explore: (\n    <>\n      <circle cx=\"12\" cy=\"12\" r=\"8\" />\n      <path d=\"m15.2 8.8-2 4.4-4.4 2 2-4.4z\" />\n    </>\n  ),\n  inbox: (\n    <>\n      <path d=\"M4 13.5 6.2 6h11.6l2.2 7.5V18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1z\" />\n      <path d=\"M4 13.5h4.5l1.2 2h4.6l1.2-2H20\" />\n    </>\n  ),\n  activity: <path d=\"M3 12h4l2.5-6 5 12 2.5-6h4\" />,\n  profile: (\n    <>\n      <circle cx=\"12\" cy=\"8.5\" r=\"3.8\" />\n      <path d=\"M4.5 20c1.3-3.6 4.1-5.2 7.5-5.2s6.2 1.6 7.5 5.2\" />\n    </>\n  ),\n  plus: (\n    <>\n      <rect x=\"4\" y=\"4\" width=\"16\" height=\"16\" rx=\"5\" />\n      <path d=\"M12 8.5v7M8.5 12h7\" />\n    </>\n  ),\n  calendar: (\n    <>\n      <rect x=\"4\" y=\"5.5\" width=\"16\" height=\"14.5\" rx=\"3\" />\n      <path d=\"M4 10h16M8.5 3.5v4M15.5 3.5v4\" />\n    </>\n  ),\n  bag: (\n    <>\n      <path d=\"M5.5 8h13l-1 12h-11z\" />\n      <path d=\"M9 10V7a3 3 0 0 1 6 0v3\" />\n    </>\n  ),\n};\n\nconst people = [\n  { n: \"Maya Okafor\", d: \"Ran 8.2 km along the river\", c: \"#0ea5e9\", t: \"2m\" },\n  { n: \"Jonas Weber\", d: \"Joined Saturday Long Run\", c: \"#8b5cf6\", t: \"14m\" },\n  { n: \"Priya Raman\", d: \"New 5K best: 23:41\", c: \"#f97316\", t: \"1h\" },\n  { n: \"Leo Hart\", d: \"Cheered your tempo run\", c: \"#10b981\", t: \"3h\" },\n];\n\nfunction initials(n: string) {\n  return n\n    .split(\" \")\n    .map((p) => p[0])\n    .join(\"\");\n}\n\nfunction Screen({ kind, title }: { kind: number; title: string }) {\n  if (kind === 0) {\n    return (\n      <>\n        <h3 className=\"hb-yh4-h\">{title}</h3>\n        <div className=\"hb-yh4-hero\">\n          <div className=\"hb-yh4-hk\">THIS WEEK</div>\n          <div className=\"hb-yh4-hv\">31.4 km</div>\n          <div className=\"hb-yh4-hs\">4 runs, 2h 48m moving</div>\n        </div>\n        <div className=\"hb-yh4-rows\">\n          {people.slice(0, 3).map((p) => (\n            <div key={p.n} className=\"hb-yh4-r\">\n              <span className=\"hb-yh4-av\" style={{ background: p.c }}>\n                {initials(p.n)}\n              </span>\n              <span className=\"hb-yh4-rt\">\n                <span className=\"hb-yh4-rn\">{p.n}</span>\n                <span className=\"hb-yh4-rd\">{p.d}</span>\n              </span>\n              <span className=\"hb-yh4-rx\">{p.t}</span>\n            </div>\n          ))}\n        </div>\n      </>\n    );\n  }\n  if (kind === 1) {\n    const tiles = [\n      [\"Trail loops\", \"linear-gradient(160deg,#065f46,#0f766e)\"],\n      [\"Track nights\", \"linear-gradient(160deg,#7c2d12,#c2410c)\"],\n      [\"Hill repeats\", \"linear-gradient(160deg,#312e81,#6d28d9)\"],\n      [\"Easy 5K\", \"linear-gradient(160deg,#0c4a6e,#0369a1)\"],\n    ];\n    return (\n      <>\n        <h3 className=\"hb-yh4-h\">{title}</h3>\n        <div className=\"hb-yh4-search\">\n          <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n            <circle cx=\"7\" cy=\"7\" r=\"4.5\" />\n            <path d=\"m10.5 10.5 3 3\" />\n          </svg>\n          Routes, clubs, people\n        </div>\n        <div className=\"hb-yh4-chips\">\n          {[\"Near me\", \"Under 5 km\", \"Trails\", \"Flat\"].map((c) => (\n            <span key={c} className=\"hb-yh4-chip\">\n              {c}\n            </span>\n          ))}\n        </div>\n        <div className=\"hb-yh4-tiles\">\n          {tiles.map(([t, g]) => (\n            <div key={t} className=\"hb-yh4-tile\" style={{ background: g }}>\n              {t}\n            </div>\n          ))}\n        </div>\n      </>\n    );\n  }\n  if (kind === 2) {\n    return (\n      <>\n        <h3 className=\"hb-yh4-h\">{title}</h3>\n        <div className=\"hb-yh4-rows\">\n          {people.map((p, i) => (\n            <div key={p.n} className=\"hb-yh4-r\">\n              <span className=\"hb-yh4-av\" style={{ background: p.c }}>\n                {initials(p.n)}\n              </span>\n              <span className=\"hb-yh4-rt\">\n                <span className=\"hb-yh4-rn\">{p.n}</span>\n                <span className=\"hb-yh4-rd\">{[\"See you at 7 by the bridge?\", \"Route for Sunday is up\", \"Thanks for the pacing!\", \"Shoes arrived, trying them\"][i]}</span>\n              </span>\n              <span className=\"hb-yh4-rx\">\n                {p.t}\n                {i < 3 && <b />}\n              </span>\n            </div>\n          ))}\n        </div>\n      </>\n    );\n  }\n  if (kind === 3) {\n    const C = 2 * Math.PI * 70;\n    return (\n      <>\n        <h3 className=\"hb-yh4-h\">{title}</h3>\n        <div className=\"hb-yh4-ring\">\n          <svg viewBox=\"0 0 170 170\" aria-hidden=\"true\">\n            <circle cx=\"85\" cy=\"85\" r=\"70\" stroke=\"rgba(255,255,255,.07)\" />\n            <circle cx=\"85\" cy=\"85\" r=\"70\" stroke=\"var(--hb-yh4-accent)\" strokeDasharray={C.toFixed(2)} strokeDashoffset={(C * 0.28).toFixed(2)} />\n          </svg>\n          <div className=\"hb-yh4-rc\">\n            <b>72%</b>\n            <span>of weekly goal</span>\n          </div>\n        </div>\n        <div className=\"hb-yh4-rows\">\n          <div className=\"hb-yh4-r\">\n            <span className=\"hb-yh4-rt\">\n              <span className=\"hb-yh4-rn\">Tempo run, 6.4 km</span>\n              <span className=\"hb-yh4-rd\">Avg pace 4:58 /km</span>\n            </span>\n            <span className=\"hb-yh4-rx\">Today</span>\n          </div>\n        </div>\n      </>\n    );\n  }\n  return (\n    <div className=\"hb-yh4-me\">\n      <div className=\"hb-yh4-big\">\n        <span>AR</span>\n      </div>\n      <div className=\"hb-yh4-mn\">Ana Ribeiro</div>\n      <div className=\"hb-yh4-ms\">Lisbon Harriers, since 2024</div>\n      <div className=\"hb-yh4-stats\">\n        <div>\n          412<span>km</span>\n        </div>\n        <div>\n          58<span>runs</span>\n        </div>\n        <div>\n          21<span>kudos</span>\n        </div>\n      </div>\n    </div>\n  );\n}\n\nexport function NavTabBar({\n  tabs = defaultTabs,\n  value,\n  defaultValue = 0,\n  onValueChange,\n  showLabels = true,\n  accent = \"#22d3ee\",\n  showBackdrop = true,\n  className = \"\",\n  style,\n  \"aria-label\": ariaLabel = \"App\",\n  ...rest\n}: NavTabBarProps) {\n  const [inner, setInner] = React.useState(defaultValue);\n  const [flip, setFlip] = React.useState(false);\n  const current = value ?? inner;\n  const listRef = React.useRef<HTMLUListElement>(null);\n\n  function pick(i: number) {\n    if (i === current) return;\n    if (value === undefined) setInner(i);\n    setFlip((f) => !f);\n    onValueChange?.(i, tabs[i]!);\n  }\n\n  function onKey(e: React.KeyboardEvent) {\n    const nodes = listRef.current ? Array.from(listRef.current.querySelectorAll<HTMLElement>(\"[data-hb-yh4-tab]\")) : [];\n    const at = nodes.indexOf(document.activeElement as HTMLElement);\n    if (at < 0) return;\n    let next = -1;\n    if (e.key === \"ArrowRight\") next = (at + 1) % nodes.length;\n    else if (e.key === \"ArrowLeft\") next = (at - 1 + nodes.length) % nodes.length;\n    else if (e.key === \"Home\") next = 0;\n    else if (e.key === \"End\") next = nodes.length - 1;\n    if (next < 0) return;\n    e.preventDefault();\n    nodes[next]?.focus();\n    pick(next);\n  }\n\n  const bar = (\n    <div className=\"hb-yh4-barwrap\">\n      <ul ref={listRef} className=\"hb-yh4-bar\" onKeyDown={onKey} style={{ \"--hb-yh4-n\": tabs.length, \"--hb-yh4-i\": current } as React.CSSProperties}>\n        <li className=\"hb-yh4-blob\" data-k={flip ? \"b\" : \"a\"} aria-hidden=\"true\" />\n        {tabs.map((tab, i) => {\n          const active = i === current;\n          const inside = (\n            <>\n              <span className=\"hb-yh4-ico\">\n                <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n                  {paths[tab.icon]}\n                </svg>\n                {tab.badge !== undefined && tab.badge !== false && (\n                  <span className=\"hb-yh4-badge\" data-dot={tab.badge === true ? \"true\" : \"false\"} aria-hidden=\"true\">\n                    {typeof tab.badge === \"number\" ? (tab.badge > 99 ? \"99+\" : tab.badge) : null}\n                  </span>\n                )}\n              </span>\n              {showLabels ? <span className=\"hb-yh4-lab\">{tab.label}</span> : <span className=\"hb-yh4-sr\">{tab.label}</span>}\n              {typeof tab.badge === \"number\" && <span className=\"hb-yh4-sr\">, {tab.badge} new</span>}\n              {tab.badge === true && <span className=\"hb-yh4-sr\">, new activity</span>}\n            </>\n          );\n          return (\n            <li key={tab.label} className=\"hb-yh4-li\">\n              {tab.href ? (\n                <a\n                  href={tab.href}\n                  className=\"hb-yh4-btn\"\n                  data-hb-yh4-tab=\"\"\n                  aria-current={active ? \"page\" : undefined}\n                  tabIndex={active ? 0 : -1}\n                  onClick={() => pick(i)}\n                >\n                  {inside}\n                </a>\n              ) : (\n                <button\n                  type=\"button\"\n                  className=\"hb-yh4-btn\"\n                  data-hb-yh4-tab=\"\"\n                  aria-current={active ? \"page\" : undefined}\n                  tabIndex={active ? 0 : -1}\n                  onClick={() => pick(i)}\n                >\n                  {inside}\n                </button>\n              )}\n            </li>\n          );\n        })}\n      </ul>\n    </div>\n  );\n\n  return (\n    <nav\n      aria-label={ariaLabel}\n      className={`hb-yh4 ${className}`}\n      data-backdrop={showBackdrop ? \"true\" : \"false\"}\n      style={{ \"--hb-yh4-accent\": accent, ...style } as React.CSSProperties}\n      {...rest}\n    >\n      <style href=\"hb-nav-tab-bar\" precedence=\"default\">\n        {css}\n      </style>\n      {showBackdrop ? (\n        <>\n          <div className=\"hb-yh4-side\" data-at=\"l\" aria-hidden=\"true\">\n            <div className=\"hb-yh4-sk\">Weekly distance</div>\n            <div className=\"hb-yh4-sv\">\n              31.4 km<em>+12%</em>\n            </div>\n            <div className=\"hb-yh4-spark\">\n              {[40, 62, 35, 70, 52, 80, 96].map((h, i) => (\n                <i key={i} style={{ height: `${h}%` }} />\n              ))}\n            </div>\n          </div>\n          <div className=\"hb-yh4-side\" data-at=\"r\" aria-hidden=\"true\">\n            <div className=\"hb-yh4-sk\">Unread in Inbox</div>\n            <div className=\"hb-yh4-sv\">\n              3<em>from your club</em>\n            </div>\n          </div>\n          <div className=\"hb-yh4-phone\">\n            <div className=\"hb-yh4-screen\">\n              <span className=\"hb-yh4-island\" aria-hidden=\"true\" />\n              <div className=\"hb-yh4-status\" aria-hidden=\"true\">\n                <span>9:41</span>\n                <svg viewBox=\"0 0 38 12\">\n                  <rect x=\"0\" y=\"7\" width=\"3\" height=\"5\" rx=\"1\" />\n                  <rect x=\"5\" y=\"5\" width=\"3\" height=\"7\" rx=\"1\" />\n                  <rect x=\"10\" y=\"2.5\" width=\"3\" height=\"9.5\" rx=\"1\" />\n                  <rect x=\"15\" y=\"0\" width=\"3\" height=\"12\" rx=\"1\" />\n                  <rect x=\"23\" y=\"1\" width=\"13\" height=\"10\" rx=\"3\" fill=\"none\" stroke=\"#ededed\" strokeWidth=\"1.2\" />\n                  <rect x=\"25\" y=\"3\" width=\"8\" height=\"6\" rx=\"1.5\" />\n                </svg>\n              </div>\n              <div className=\"hb-yh4-view\" aria-hidden=\"true\">\n                <div className=\"hb-yh4-track\" style={{ \"--hb-yh4-i\": current } as React.CSSProperties}>\n                  {tabs.map((tab, i) => (\n                    <div key={tab.label} className=\"hb-yh4-page\">\n                      <Screen kind={i % 5} title={tab.label} />\n                    </div>\n                  ))}\n                </div>\n              </div>\n              {bar}\n            </div>\n          </div>\n        </>\n      ) : (\n        bar\n      )}\n    </nav>\n  );\n}\n"
    }
  ]
}