The BasicNumberTicker component creates a smooth, animated numeric transition from a starting value to a target value. Leveraging Framer Motion's robust layout engines, it provides precise control over speed, easing, and timing, making it perfect for dynamic statistics, growth metrics, and dashboards.
Preview
0%
Usage
Installation
$ npx shadcn@latest add https://spark-ui-olive.vercel.app/r/basic-number-ticker.json
Basic Example
import NumberTicker from "@/components/ui/basic-number-ticker";
export default function App() {
return (
<div className="text-3xl font-normal font-mono">
<NumberTicker from={0} target={99} />%
</div>
);
}
Variants Preview
Avg. Latency
1.2s linear transition
10ms
Uptime Guarantee
2.5s easeOut transition
90%
Deployments
Manual trigger
+0
Properties
| Prop | Type | Default | Description |
|---|---|---|---|
from | number | 0 | The starting numeric value of the animation. |
target | number | 100 | The target numeric value to count up or down to. |
transition | ValueAnimationTransition | { duration: 3, type: "tween", ease: "easeInOut" } | Animation configuration, matching standard Framer Motion animation properties (tween/spring, duration, ease, etc.). |
className | string | — | Additional CSS classes for custom styling. |
onStart | () => void | — | Callback function invoked when the animation begins. |
onComplete | () => void | — | Callback function invoked when the animation finishes. |
autoStart | boolean | true | If true, start the count animation automatically when mounted. |