Smart Animate Text
Per-character blur-slide animation. Values update directly while changed digits and letters animate up, down, or dynamically.
Installation
Pro components require registry authentication. Add your Unlumen UI Pro key as UNLUMEN_LICENSE_KEY in your .env.local file and follow the setup guide.
File Structure
Usage
import { SmartAnimateText } from "@/components/unlumen-ui/smart-animate-text";
export default function Example() {
return <SmartAnimateText value="mon." className="text-6xl font-bold" />;
}API Reference
valuestring—The string to display. Each digit or letter that changes between renders animates independently. Punctuation characters (e.g. `:`, `.`, `/`) are rendered statically.
gap?number2Spacing in pixels between characters.
className?string—Additional classes applied to the outer flex container.
digitClassName?string—Additional classes applied to each animatable character wrapper.
staggerDelay?number0.04Delay in seconds between each changed character animation. Unchanged characters are skipped.
enterStiffness?number170Spring stiffness for entering and exiting characters.
enterDamping?number10Spring damping for entering and exiting characters.
direction?"dynamic" | "up" | "down""dynamic"`dynamic` infers direction from the full numeric value (up when the value increases, down when it decreases). `up` and `down` force a fixed direction regardless of the value.
enterY?number32Vertical offset in pixels from which the entering character slides in.
enterBlur?number52Blur amount in pixels applied to the entering character at the start of its animation.
enterScale?number0.7Scale applied to the entering character at the start of its animation.
Notes
- Digits (
0–9) and letters animate. Separator characters like:,., or/are rendered as plain<span>elements and never trigger an animation. - Changed characters animate with a small left-to-right stagger. Characters that keep the same value are excluded from the delay order.
- Direction is inferred from the full numeric value when
direction="dynamic":9to10animates changed and newly mounted digits upward, while10to9animates them downward. Force a fixed direction with"up"or"down". - Smart Animate Text renders the latest
valuedirectly. It does not queue previous values or animate through intermediate numbers.
Credits
Built by leo.
Keep in mind
Most components on this site are inspired by or recreated from existing work across the web. I'm not here to take credit; just to learn, experiment, and sometimes push things a bit further. If something looks familiar and I forgot to mention you, reach out and I'll fix that right away.
This component is part of Unlumen UI [ Pro ]
Includes advanced motion, patterns, and premium support.