About
A number display that smoothly rolls each digit up or down when its value changes, with optional prefix, suffix, decimals and locale formatting.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Animated Counter to your project and fits it to your theme.
Code
How Animated Counter is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client";
import AnimatedCounter from "@/components/ui/animated-counter";
import * as React from "react";
export default function AnimatedCounterDemo() {
const [value, setValue] = React.useState(128400);
React.useEffect(() => {
const interval = setInterval(() => {
setValue((previous) => previous + Math.floor(Math.random() * 400) - 150);
}, 2200);
return () => clearInterval(interval);
}, []);
return (
<div className="flex h-screen w-full items-center justify-center bg-background text-foreground">
<AnimatedCounter
value={value}
label="Total revenue"
prefix="$"
className="text-5xl font-semibold tabular-nums"
/>
</div>
);
}
















