Basic Number Ticker

A premium animated number ticker component with custom start, target values, transition configurations, and callbacks.

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%

Installation

$ npx shadcn@latest add https://spark-ui-olive.vercel.app/r/basic-number-ticker.json

Usage

import NumberTicker from "@/components/basic-number-ticker";
export default function BasicNumberTickerDemo() {
  return (
    <div className="flex items-center justify-center">
      <span className="text-5xl sm:text-6xl font-normal text-zinc-900 dark:text-zinc-50 font-mono">
        <NumberTicker from={0} target={99} />
        <span>%</span>
      </span>
    </div>
  );
}

Variants Preview

Avg. Latency

1.2s linear transition

10ms
Uptime Guarantee

2.5s easeOut transition

90%
Deployments

Manual trigger

+0

Properties

PropTypeDefaultDescription
fromnumber0The starting numeric value of the animation.
targetnumber100The target numeric value to count up or down to.
transitionValueAnimationTransition{ duration: 3, type: "tween", ease: "easeInOut" }Animation configuration, matching standard Framer Motion animation properties (tween/spring, duration, ease, etc.).
classNamestringAdditional CSS classes for custom styling.
onStart() => voidCallback function invoked when the animation begins.
onComplete() => voidCallback function invoked when the animation finishes.
autoStartbooleantrueIf true, start the count animation automatically when mounted.