animate.css, gsap, react-spring, and velocity-animate are tools for adding motion to web interfaces. animate.css provides ready-made CSS classes for simple effects. gsap is a powerful JavaScript engine for complex timelines and control. react-spring uses physics-based springs tailored for React applications. velocity-animate is a legacy jQuery-based tool that is no longer maintained.
Choosing the right animation tool depends on your project stack, performance needs, and how much control you require over motion. animate.css, gsap, react-spring, and velocity-animate each solve this problem differently. Let's compare how they handle implementation, control, framework integration, and maintenance.
animate.css relies on predefined CSS classes.
<!-- animate.css: Add class to trigger -->
<div class="animate__animated animate__fadeIn">
Content
</div>
gsap uses a JavaScript API to target elements.
// gsap: JavaScript API
import gsap from "gsap";
gsap.to(".box", { x: 100, duration: 1 });
react-spring uses React hooks to bind values.
// react-spring: Hook-based
import { useSpring, animated } from "@react-spring/web";
const props = useSpring({ x: 100 });
return <animated.div style={props}>Content</animated.div>;
velocity-animate uses a jQuery-like chain.
.velocity().// velocity-animate: jQuery chain
$(".box").velocity({ left: "100px" }, { duration: 1000 });
animate.css has no built-in sequencing.
// animate.css: Manual class toggle
el.classList.add("animate__fadeIn");
setTimeout(() => el.classList.add("animate__fadeOut"), 1000);
gsap excels at timelines and sequencing.
// gsap: Timeline sequencing
const tl = gsap.timeline();
tl.to(".box", { x: 100 }).to(".box", { y: 100 });
react-spring uses physics instead of time.
// react-spring: State-driven sequence
const [state, setState] = useState(false);
const props = useSpring({ x: state ? 100 : 0 });
// Toggle state to trigger animation
velocity-animate supports basic chaining.
.velocity() calls.// velocity-animate: Basic chain
$(".box").velocity({ left: "100px" }).velocity({ top: "100px" });
animate.css works via DOM manipulation.
// animate.css: React useEffect
useEffect(() => {
ref.current.classList.add("animate__fadeIn");
}, []);
gsap can be used imperatively in React.
// gsap: React useRef
const ref = useRef();
useEffect(() => {
gsap.to(ref.current, { x: 100 });
}, []);
react-spring is built for React.
// react-spring: Native React integration
const AnimatedDiv = animated.div;
return <AnimatedDiv style={props}>Content</AnimatedDiv>;
velocity-animate is not React-friendly.
// velocity-animate: Direct DOM manipulation
useEffect(() => {
$(ref.current).velocity({ x: 100 });
}, []);
animate.css is actively maintained.
gsap is actively maintained.
react-spring is actively maintained.
velocity-animate is no longer maintained.
gsap or Web Animations API.// velocity-animate: Legacy warning
// ⚠️ This package is deprecated. Use gsap instead.
$(".box").velocity({ x: 100 });
| Feature | animate.css | gsap | react-spring | velocity-animate |
|---|---|---|---|---|
| Type | CSS Classes | JS API | React Hooks | jQuery Plugin |
| Control | Low | High | Medium (Physics) | Medium |
| React Ready | Manual | Imperative | Native | No |
| Status | ✅ Active | ✅ Active | ✅ Active | ❌ Deprecated |
animate.css is like a box of presets 🎁 — great for standard effects without custom code. Use it for simple fade-ins on landing pages.
gsap is like a professional film rig 🎬 — perfect for complex scenes, timelines, and high-performance needs. Use it for marketing sites or heavy motion.
react-spring is like a natural force field 🌊 — ideal for React apps where motion responds to user state. Use it for interactive dashboards or UI feedback.
velocity-animate is like an old tool in the shed 🧰 — keep it only if you maintain legacy code. For anything new, choose gsap or react-spring.
Final Thought: All four libraries add motion, but they fit different architectural needs. Match the tool to your stack and maintenance requirements.
Choose react-spring if you are building a React application and want animations driven by state changes. It provides natural, physics-based movement that integrates tightly with React renders. It is ideal for interactive UI elements like draggables or toggles.
Choose animate.css for quick, standard entrance or exit effects without writing custom animation logic. It is best for static sites or simple interactions where adding a CSS class is enough. Avoid it if you need complex sequencing or dynamic control over animation values.
Choose gsap for complex, high-performance animations that require precise timelines and control. It works well with any JavaScript framework and handles heavy lifting like SVG motion. It is the industry standard for professional motion design on the web.
Do not choose velocity-animate for new projects as it is no longer maintained and relies on jQuery. Existing projects using it should plan to migrate to gsap or native Web Animations API. It is only relevant for legacy code maintenance.
react-spring is a cross-platform spring-physics first animation library.
It's as simple as:
const styles = useSpring({
from: {
opacity: 0
},
to: {
opacity: 1
}
})
<animated.div style={styles} />
Just a small bit about us:
react-dom, react-native, react-three-fiber, react-konva & react-zdog.There's a lot more to be had! Give it a try and find out.
# Install the entire library
npm install react-spring
# or just install your specific target (recommended)
npm install @react-spring/web
import { animated, useSpring } from '@react-spring/web'
const FadeIn = ({ isVisible, children }) => {
const styles = useSpring({
opacity: isVisible ? 1 : 0,
y: isVisible ? 0 : 24,
})
return <animated.div style={styles}>{children}</animated.div>
}
It's as simple as that to create scroll-in animations when value of isVisible is toggled.
More documentation on the project can be found here.
Pages contain their own examples which you can check out there, or open in codesandbox for a more in-depth view!
And many others...
Thank you to all our backers! 🙏 If you want to join them here, then consider contributing to our Opencollective.
This project exists thanks to all the people who contribute.