Installation
Install React Spring via npm or yarn:Basic usage
React Spring uses spring-physics to create natural-looking animations. The core hook isuseSpring, which returns animated values you can apply to elements.
Configuration options
React Spring provides intuitive physics-based configuration:- Tension
- Friction
- Presets
Controls the spring’s strength. Higher values create faster, snappier animations.
Key features
Spring physics
Natural motion based on spring physics rather than duration-based easing curves.
Interpolation
Smoothly interpolate between any values including colors, transforms, and custom properties.
Performance
Runs animations off the main thread for smooth 60fps performance.
Declarative
Define what you want animated, not how it should animate.
Multiple values with useSpring
Animate multiple properties simultaneously:Chaining animations with useChain
Orchestrate multiple animations in sequence:Trail animations
Animate a list of items with a stagger effect:When to use it
Natural, physics-based motion
Natural, physics-based motion
Choose React Spring when you want animations that feel natural and organic, mimicking real-world physics instead of artificial easing curves.
Minimal configuration
Minimal configuration
Perfect when you want great-looking animations without tweaking duration and easing values. Spring physics automatically creates smooth motion.
Dynamic animations
Dynamic animations
Ideal for animations that change direction mid-flight or respond to rapidly changing data without jarring transitions.
Performance-critical apps
Performance-critical apps
React Spring runs animations off the main thread, making it excellent for performance-sensitive applications.
Comparison with Framer Motion
Both libraries are excellent choices, but they have different philosophies:- React Spring
- Framer Motion
Strengths:
- Spring-physics based (more natural motion)
- Smaller bundle size
- Automatic interruption handling
- Runs off main thread
- Data visualizations
- Smooth, natural transitions
- Performance-critical applications
Example from the playground
Here’s the comparison demo from the Animation Playground:Learn more
Animation examples
See React Spring in action
Official docs
Visit the React Spring documentation