Animations
CountUp
Animate a number from 0 (or any value) up to a target with easing.
Quick Preview
0
Installation
npm install framer-motion
// Copy fromsrc/components/animations/CountUp.tsx
Examples
Stats banner
$0K
Monthly Revenue
0.0%
Uptime
0
Active Users
Prompt Preview
Copy a prompt that recreates this UI
Paste this into your AI coding assistant to generate code that closely matches the reference, including color, size, shape, typography, spacing, and polish.
Copy-ready AI prompt
Starts from the current visual reference and project constraints.
Tweak only product-specific copy or data after the first generation pass.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
to* | number | - | Target number to count to |
from | number | 0 | Starting number |
duration | number | 2 | Animation duration (seconds) |
decimals | number | 0 | Decimal places to display |
prefix | string | - | Text before number (e.g. "$") |
suffix | string | - | Text after number (e.g. "%") |
easing | 'easeOut' | 'easeInOut' | 'linear' | 'easeOut' | Easing function |
locale | string | - | Locale for number formatting (e.g. "en-US") |
whenInView | boolean | false | Trigger when in viewport |
className | string | - | Additional CSS classes |