Installation
Usage
Examples
Count Up Animation
Count Down Animation
With Decimal Places
With Delay
Large Numbers with Formatting
Props
The target value to animate to.
The initial value to start the animation from.
The direction of the animation.
"up" counts from startValue to value, "down" counts from value to startValue.Delay in seconds before the animation starts.
Number of decimal places to display.
Additional CSS classes to apply to the component.
Features
- Spring physics animation for natural movement
- Automatic number formatting with locale support
- Intersection observer triggers animation when visible
- Support for both count-up and count-down animations
- Configurable decimal places
- Delay option for staggered animations
Animation Details
- Uses spring physics with damping (60) and stiffness (100) for realistic motion
- Animates at approximately 60fps for smooth visuals
- Numbers are formatted using
Intl.NumberFormatwith en-US locale - Animation triggers when the element enters the viewport
Dependencies
- motion-sv (for
inViewobserver)