{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "standings-benchmark-demo",
  "type": "registry:block",
  "title": "Standings: Benchmark Tabs",
  "description": "Animated Leaderboard example, Benchmark Tabs: A model leaderboard on four benchmarks. Switch the tab and the same six models race to their new order. A take on the leaderboard (ranking). Fits hero, features and stats sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "hero",
    "features",
    "stats",
    "leaderboard",
    "chart",
    "data",
    "motion"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/standings#standings-benchmark-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/standings.json"
  ],
  "files": [
    {
      "path": "components/standings-benchmark-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { Standings, type StandingsEntry } from \"@/components/ui/standings\";\n\nconst CYCLE = 3400; // ms each benchmark stays up while the tabs play by themselves\n\ntype Model = { id: string; label: string; detail: string; color: string; you?: boolean };\n\n// Kestrel Labs' Wren 3 against five other open and hosted models, on four\n// benchmarks from the same evaluation run.\nconst MODELS: Model[] = [\n  { id: \"wren\", label: \"Wren 3\", detail: \"Kestrel Labs · 32B\", color: \"#ff5a1f\", you: true },\n  { id: \"halcyon\", label: \"Halcyon Pro\", detail: \"Halcyon · hosted\", color: \"#2563eb\" },\n  { id: \"gannet\", label: \"Gannet XL\", detail: \"Northgate · 120B\", color: \"#7c3aed\" },\n  { id: \"osprey\", label: \"Osprey 70B\", detail: \"Fernhill AI · 70B\", color: \"#059669\" },\n  { id: \"marlin\", label: \"Marlin 2\", detail: \"Tidewater · 8×22B\", color: \"#db2777\" },\n  { id: \"petrel\", label: \"Petrel Mini\", detail: \"Fernhill AI · 8B\", color: \"#d97706\" },\n];\n\ntype Benchmark = {\n  id: string;\n  label: string;\n  unit: string;\n  best?: \"highest\" | \"lowest\";\n  max?: number;\n  format: (v: number) => string;\n  scores: Record<string, number>;\n};\n\nconst BENCHMARKS: Benchmark[] = [\n  {\n    id: \"reasoning\",\n    label: \"Reasoning\",\n    unit: \"Accuracy on 1,400 multi-step problems\",\n    max: 100,\n    format: (v) => `${v.toFixed(1)}%`,\n    scores: { halcyon: 84.1, gannet: 81.7, wren: 79.4, osprey: 76.2, marlin: 72.8, petrel: 61.5 },\n  },\n  {\n    id: \"coding\",\n    label: \"Coding\",\n    unit: \"Tasks passed on the first try\",\n    max: 100,\n    format: (v) => `${v.toFixed(1)}%`,\n    scores: { wren: 71.3, halcyon: 69.8, marlin: 66, gannet: 64.2, osprey: 58.9, petrel: 49.1 },\n  },\n  {\n    id: \"speed\",\n    label: \"Speed\",\n    unit: \"Output tokens per second\",\n    format: (v) => `${Math.round(v)}/s`,\n    scores: { petrel: 412, wren: 268, marlin: 231, osprey: 174, halcyon: 122, gannet: 96 },\n  },\n  {\n    id: \"price\",\n    label: \"Price\",\n    unit: \"Dollars per million output tokens, lowest first\",\n    best: \"lowest\",\n    format: (v) => `$${v.toFixed(2)}`,\n    scores: { petrel: 0.4, wren: 0.9, marlin: 1.6, osprey: 2.1, gannet: 6, halcyon: 12 },\n  },\n];\n\nfunction Mark({ color, label }: { color: string; label: string }) {\n  return (\n    <span\n      className=\"grid size-full place-items-center text-[13px] font-semibold text-white\"\n      style={{ backgroundImage: `linear-gradient(150deg, ${color}cc, ${color})` }}\n    >\n      {label[0]}\n    </span>\n  );\n}\n\nconst reducedQuery = \"(prefers-reduced-motion: reduce)\";\n\nexport function StandingsBenchmarkDemo() {\n  const [active, setActive] = React.useState(0);\n  const [picked, setPicked] = React.useState(false);\n  const tabs = React.useRef<(HTMLButtonElement | null)[]>([]);\n  const benchmark = BENCHMARKS[active];\n\n  // The tabs play by themselves until a visitor picks one.\n  React.useEffect(() => {\n    if (picked || window.matchMedia(reducedQuery).matches) return;\n    const id = window.setTimeout(() => setActive((i) => (i + 1) % BENCHMARKS.length), CYCLE);\n    return () => window.clearTimeout(id);\n  }, [active, picked]);\n\n  const entries = React.useMemo<StandingsEntry[]>(\n    () =>\n      MODELS.map((m) => ({\n        id: m.id,\n        label: m.label,\n        detail: m.detail,\n        you: m.you,\n        value: benchmark.scores[m.id],\n        icon: <Mark color={m.color} label={m.label} />,\n      })),\n    [benchmark],\n  );\n\n  const pick = (i: number) => {\n    setPicked(true);\n    setActive(i);\n  };\n\n  const onKeyDown = (e: React.KeyboardEvent) => {\n    const step = e.key === \"ArrowRight\" ? 1 : e.key === \"ArrowLeft\" ? -1 : 0;\n    if (!step) return;\n    e.preventDefault();\n    const next = (active + step + BENCHMARKS.length) % BENCHMARKS.length;\n    pick(next);\n    tabs.current[next]?.focus();\n  };\n\n  return (\n    <div className=\"w-full max-w-xl rounded-2xl border border-zinc-950/[0.08] bg-white text-zinc-950 shadow-[0_1px_2px_rgb(0_0_0/0.04),0_12px_32px_-12px_rgb(0_0_0/0.12)] dark:border-white/10 dark:bg-zinc-950 dark:text-zinc-50\">\n      <div className=\"border-b border-zinc-950/[0.07] px-5 pt-4 pb-4 dark:border-white/[0.08]\">\n        <div className=\"flex items-baseline justify-between gap-3\">\n          <p className=\"text-[13px] font-semibold tracking-[-0.01em]\">Open leaderboard</p>\n          <p className=\"text-xs text-zinc-500 dark:text-zinc-400\">Run of Nov 2</p>\n        </div>\n        <div\n          role=\"tablist\"\n          aria-label=\"Benchmark\"\n          onKeyDown={onKeyDown}\n          className=\"mt-3 grid grid-cols-4 gap-1 rounded-full bg-zinc-100 p-1 dark:bg-white/[0.06]\"\n        >\n          {BENCHMARKS.map((b, i) => (\n            <button\n              key={b.id}\n              ref={(el) => {\n                tabs.current[i] = el;\n              }}\n              type=\"button\"\n              role=\"tab\"\n              aria-selected={i === active}\n              tabIndex={i === active ? 0 : -1}\n              onClick={() => pick(i)}\n              className={cn(\n                \"h-8 rounded-full text-xs font-medium transition-[background-color,color,box-shadow] duration-150 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-[#ff5a1f]\",\n                i === active\n                  ? \"bg-white text-zinc-950 shadow-[0_1px_2px_rgb(0_0_0/0.08),0_0_0_1px_rgb(0_0_0/0.04)] dark:bg-zinc-800 dark:text-white\"\n                  : \"text-zinc-500 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white\",\n              )}\n            >\n              {b.label}\n            </button>\n          ))}\n        </div>\n        <p className=\"mt-3 text-xs text-zinc-500 dark:text-zinc-400\">{benchmark.unit}</p>\n      </div>\n      <Standings\n        role=\"tabpanel\"\n        aria-label={`${benchmark.label} leaderboard`}\n        entries={entries}\n        best={benchmark.best}\n        max={benchmark.max}\n        format={benchmark.format}\n        change={false}\n        className=\"px-2 pt-1 pb-2 [--standings-surface:#ffffff] dark:[--standings-surface:#09090b]\"\n      />\n    </div>\n  );\n}\n"
    }
  ]
}