{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "animated-number",
  "title": "Animated Number",
  "description": "An animated number component.",
  "registryDependencies": [
    "https://www.dashboardblocks.com/r/radix/use-animated-number.json",
    "https://www.dashboardblocks.com/r/radix/format.json"
  ],
  "files": [
    {
      "path": "registry/components/dashboardblocks/animated-number.tsx",
      "content": "'use client'\n\nimport { useAnimatedNumber } from '@/registry/hooks/use-animated-number'\nimport { formatNumber } from '@/registry/lib/dashboardblocks/format'\nimport type { ReactNode } from 'react'\n\ninterface AnimatedNumberProps {\n  value: number\n  /** Milliseconds, 1000 by default. */\n  duration?: number\n  /** @default 'easeOut' */\n  easing?: 'linear' | 'easeOut' | 'easeIn' | 'easeInOut' | 'spring'\n  /** @default 0 */\n  from?: number\n  /** Milliseconds, 0 by default. */\n  delay?: number\n  formatter?: (value: number) => ReactNode\n  className?: string\n}\n\nexport function AnimatedNumber({\n  className,\n  delay = 0,\n  duration = 1000,\n  easing = 'easeOut',\n  formatter,\n  from = 0,\n  value: targetValue,\n}: AnimatedNumberProps) {\n  const { ref, value } = useAnimatedNumber(targetValue, {\n    delay,\n    duration,\n    easing,\n    from,\n  })\n\n  const displayValue = formatter\n    ? formatter(value)\n    : formatNumber(value, { maximumFractionDigits: 3 })\n\n  return (\n    <span ref={ref as React.RefObject<HTMLSpanElement>} className={className}>\n      {displayValue}\n    </span>\n  )\n}\n",
      "type": "registry:component",
      "target": "@components/dashboardblocks/animated-number.tsx"
    }
  ],
  "type": "registry:component"
}
