Components

Animated Numbers

An accessible number counter that animates into view with locale-aware formatting, prefixes, suffixes, decimals, delays, and reduced-motion support.

animationmotionnumbersstatisticsaccessibility
38%
Faster delivery
18 hrs
Saved weekly
3.2x
Return on spend
$125,000
Revenue influenced

Installation

$npx shadcn@latest add @navui/animated-numbers

API Reference

PropTypeDefaultDescription
valuenumber-The final numeric value displayed when the animation completes.
fromnumber0The starting value used before the component enters the viewport.
prefix / suffixstring / string"" / ""Text rendered immediately before or after the formatted number.
decimalPlacesnumber0The fixed minimum and maximum number of fraction digits.
duration / delaynumber / number1 / 0Animation duration and start delay in seconds.
localestring"en-US"Locale passed to Intl.NumberFormat for separators and decimal formatting.
...propsReact.ComponentPropsWithoutRef<"span">-Native span attributes and className. Children are omitted because the formatted value is managed by the component.

Customization

  • Pass className to restyle the component. Classes are merged with cn, so your utilities win.
  • Styling uses Tailwind utility classes and theme tokens, so it adapts to light/dark mode automatically.
  • Tune behavior with the props in the API reference above, for example value.