📖 Step 5: Design - Advanced UI/UX#497 / 498

Count-Up Animation

Count-Up Animation

📖One-line summary

An animation that rolls a number up from zero or its previous value to the target value to emphasize a figure.

✨Example

✨

카운트업 애니메이션

Count-Up Animation

⚡Vibe coding prompt examples

>_

Add a count-up animation to the four dashboard stat cards (total revenue, sign-ups, orders, conversion rate). When they enter the screen, roll from 0 to the target value over 1.2 seconds with ease-out, showing thousands separators and one decimal place.

>_

Write a dependency-free useCountUp hook in src/hooks/useCountUp.ts driven by requestAnimationFrame. When the value changes, continue from the previous value to the new one, and if prefers-reduced-motion is on, show the final value immediately with no animation.

>_

Make the '12,000 total users' number on the landing page count up only once, when IntersectionObserver reports it is at least 50% inside the viewport. Apply tabular-nums too so the number's width doesn't jitter.

Try these prompts in your AI coding assistant!