{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "odometer-demo",
  "type": "registry:block",
  "title": "Odometer: Default",
  "description": "Animated Number Counter example, Default: Step the number up and down. Wheels roll the way the value moves, only the digits that change turn, and 999 → 1,000 widens as the new digit and comma roll in. Click fast: they redirect mid-roll. A take on the number counter (count up). Fits stats, pricing, hero and app UI sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "stats",
    "pricing",
    "hero",
    "app-ui",
    "number-counter",
    "number",
    "data",
    "motion"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/odometer#odometer-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/odometer.json"
  ],
  "files": [
    {
      "path": "components/odometer-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { Odometer } from \"@/components/ui/odometer\";\n\nconst MAX = 9_999_999;\n\nconst steps = [\n  { label: \"−100\", name: \"Subtract 100\", apply: (n: number) => n - 100 },\n  { label: \"−1\", name: \"Subtract 1\", apply: (n: number) => n - 1 },\n  { label: \"+1\", name: \"Add 1\", apply: (n: number) => n + 1 },\n  { label: \"+100\", name: \"Add 100\", apply: (n: number) => n + 100 },\n  { label: \"×10\", name: \"Multiply by 10\", apply: (n: number) => n * 10 },\n];\n\nconst button =\n  \"h-9 min-w-12 rounded-xl px-3 font-mono text-sm text-zinc-600 tabular-nums transition-[background-color,color,scale] duration-150 outline-none select-none hover:bg-zinc-100 hover:text-zinc-950 focus-visible:ring-2 focus-visible:ring-zinc-400 active:scale-[0.94] dark:text-zinc-400 dark:hover:bg-zinc-800 dark:hover:text-zinc-50 dark:focus-visible:ring-zinc-600\";\n\n// Click fast: every wheel turns from wherever it is.\nexport function OdometerDemo() {\n  const [value, setValue] = React.useState(1284);\n  const set = (next: number) => setValue(Math.min(MAX, Math.max(0, Math.round(next))));\n\n  const random = () => {\n    // A random length too, so the commas come and go.\n    const digits = 1 + Math.floor(Math.random() * 7);\n    set(Math.random() * 10 ** digits);\n  };\n\n  return (\n    <div className=\"flex w-full max-w-xl flex-col items-center\">\n      <p className=\"text-[clamp(3.5rem,14vw,6.5rem)] leading-none font-semibold tracking-[-0.045em] text-zinc-950 dark:text-zinc-50\">\n        <Odometer value={value} />\n      </p>\n      <div className=\"mt-12 flex flex-wrap items-center justify-center gap-0.5 rounded-2xl border border-zinc-200 bg-white p-1 shadow-sm shadow-zinc-950/5 dark:border-zinc-800 dark:bg-zinc-900 dark:shadow-black/40\">\n        {steps.map((step) => (\n          <button\n            key={step.label}\n            type=\"button\"\n            aria-label={step.name}\n            onClick={() => set(step.apply(value))}\n            className={button}\n          >\n            {step.label}\n          </button>\n        ))}\n        <span aria-hidden className=\"mx-1 h-5 w-px bg-zinc-200 dark:bg-zinc-800\" />\n        <button type=\"button\" onClick={random} className={button}>\n          Random\n        </button>\n      </div>\n    </div>\n  );\n}\n"
    }
  ]
}