{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "primitive-number-ticker",
  "type": "registry:ui",
  "title": "Number ticker",
  "description": "Show changing values with tabular figures and stable vertical digit movement.",
  "dependencies": [
    "motion"
  ],
  "categories": [
    "primitive",
    "polish-effects"
  ],
  "docs": "https://motion-lexicon.pages.dev/en/primitives/number-ticker/",
  "files": [
    {
      "path": "src/registry/primitives/number-ticker.tsx",
      "type": "registry:ui",
      "target": "components/motion-lexicon/primitives/number-ticker.tsx",
      "content": "\"use client\";\n\nimport { AnimatePresence, motion, useReducedMotion, type Transition } from \"motion/react\";\n\nconst EASE_OUT = [0.16, 1, 0.3, 1] as const;\n\nexport type NumberTickerPrimitiveProps = {\n  value: number;\n  format?: (value: number) => string;\n  duration?: number;\n  easing?: Transition[\"ease\"];\n  distance?: number;\n  className?: string;\n};\n\nexport function NumberTickerPrimitive({\n  value,\n  format = (number) => number.toLocaleString(),\n  duration = 0.24,\n  easing = EASE_OUT,\n  distance = 24,\n  className,\n}: NumberTickerPrimitiveProps) {\n  const reduceMotion = useReducedMotion();\n  const formatted = format(value);\n\n  return (\n    <span className={`relative inline-grid overflow-hidden tabular-nums ${className ?? \"\"}`} aria-live=\"polite\">\n      <AnimatePresence initial={false} mode=\"popLayout\">\n        <motion.span\n          className=\"col-start-1 row-start-1\"\n          key={value}\n          initial={reduceMotion ? { opacity: 0 } : { opacity: 0, transform: `translate3d(0, ${distance}px, 0)` }}\n          animate={{ opacity: 1, transform: \"translate3d(0, 0, 0)\" }}\n          exit={reduceMotion ? { opacity: 0 } : { opacity: 0, transform: `translate3d(0, ${-distance}px, 0)` }}\n          transition={reduceMotion ? { duration: 0.12 } : { duration, ease: easing }}\n        >\n          {formatted}\n        </motion.span>\n      </AnimatePresence>\n    </span>\n  );\n}\n"
    }
  ]
}
