Number Animation
Animated Number interpolates a numeric value and accepts a formatting function.
Practical React example
Show a changing metric without making the animation the only way to read its value.
Before you copy and paste
Keep the example in the React rendering environment required by the imported component. Copy components/motion/animated-number.tsx and its returned support files from the Code tab; preserve the project-relative paths.
Listed package dependencies: clsx, motion, react, tailwind-merge.
Use the Code tab for the component files and installation instructions, then adapt the imports in this example to your project.
Show a changing metric without making the animation the only way to read its value
// Usage adapted from beUI's pinned MIT source.
// Copyright (c) 2026 Saurabh Chauhan. See ./LICENSES.md.
"use client";
import { useEffect, useState } from "react";
import { NumberTicker } from "@/components/motion/number-ticker";
export function NumberTickerPreview() {
const [value, setValue] = useState(48273);
useEffect(() => {
const id = setInterval(() => setValue((v) => v + Math.floor(Math.random() * 50)), 2500);
return () => clearInterval(id);
}, []);
return (
<div className="flex flex-col items-center gap-3">
<p className="text-xs text-muted-foreground">Active users</p>
<NumberTicker
value={value}
prefix=""
className="text-4xl font-semibold tracking-tight text-foreground tabular-nums"
format={(n) => n.toLocaleString()}
/>
<p className="text-xs text-muted-foreground">live · updates every 2.5s</p>
</div>
);
}
Usage example adapted from beUI's pinned MIT source. Retain the source licence notices when copying.
Pass the actual numeric measurement and keep formatting deterministic across server and client. Reserve enough width for the longest expected formatted value.
Customization
- AnimatedNumberProps.value
- Required; number.
- AnimatedNumberProps.duration
- Optional; number.
- AnimatedNumberProps.format
- Optional; (n: number) => string.
- AnimatedNumberProps.className
- Optional; string.
- AnimatedNumberProps.startOnView
- Optional; boolean.
- NumberTickerProps.value
- Required; number.
- NumberTickerProps.pad
- Optional; number. Digits to pad to (left).
- NumberTickerProps.duration
- Optional; number. Per-digit roll duration in seconds.
- NumberTickerProps.stagger
- Optional; number. Stagger between digits.
- NumberTickerProps.startOnView
- Optional; boolean. Render only after the element enters the viewport.
- NumberTickerProps.prefix
- Optional; string.
- NumberTickerProps.suffix
- Optional; string.
- NumberTickerProps.blur
- Optional; boolean. Add a small blur during digit rolls.
- NumberTickerProps.className
- Optional; string.
Integration notes
- Do not imply that an animated count is a live measurement unless the data really updates.
- Keep rapid updates out of aggressive live regions and provide context such as units and time period.
Component source: beUI documentation . These examples describe the version imported into Rendyn. Upstream APIs may have changed; retain the source licence notices when adapting the code.
Give your agent taste.
The best way to use Rendyn is through MCP. Let your agent find the right component, compare previews and bring the source into your project.
All components are free. Sign up only to connect MCP.