{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"lib-count-to","type":"registry:lib","title":"count-to helpers","description":"A number that counts to its new value when it changes, for components that print numbers from their data (chart","dependencies":[],"registryDependencies":["https://dashral.com/r/lib-motion.json"],"files":[{"path":"registry/dashral/lib/count-to.tsx","type":"registry:file","target":"components/dashral/lib/count-to.tsx","content":"\"use client\"\n\n// A number that counts to its new value when it changes, for components that print numbers from their data (chart\n// legends, a gauge's value, a bar list's values). A client island, so a server-rendered list can use it too.\n\nimport * as React from \"react\"\n\nimport { useCountTo } from \"./motion\"\n\n/**\n * `value` written with the locale and options, counting from the number on screen to each new one (MetricCard's\n * count). It doesn't count on mount, and never with reduced motion. Takes the options, not an Intl.NumberFormat, so a\n * server component can pass them.\n */\nexport function CountTo({ value, locale, formatOptions }: { value: number; locale?: string; formatOptions?: Intl.NumberFormatOptions }) {\n  const shown = useCountTo(value)\n  const format = React.useMemo(() => new Intl.NumberFormat(locale, formatOptions), [locale, formatOptions])\n  return format.format(shown)\n}\n"}]}