GSAP

73kb / ~28kb gz

The most popular JavaScript animation library — animate anything on the web.


01

See It in Action

One timeline, total control — animations you can't build with CSS alone.

Cards animate in with staggered timing — a classic landing page pattern.

Preview

02

What is GSAP?

GSAP (GreenSock Animation Platform) is a JavaScript library that lets you animate anything on a webpage — move elements, change colors, fade things in and out, create scroll effects, and more. If you've seen a website with smooth, impressive animations, there's a good chance it uses GSAP.

It works with any framework (React, Vue, vanilla JS) and all modern browsers. You animate things by telling GSAP what to change and how long it should take — it handles the rest.

🎬
Animate Anything
Move, scale, rotate, fade, change colors — GSAP can animate any CSS property, SVG, or JavaScript value.
Timelines & Sequencing
Chain animations together into a sequence, overlap them, or control the whole thing with play, pause, and reverse.
🧩
Powerful Plugins
ScrollTrigger for scroll-based animations, SplitText for text effects, MorphSVG, and more — all free.

03

When to Use GSAP

Use when
Landing page animations — entrance effects, scroll reveals, hero sections
Interactive UI elements — hover effects, magnetic buttons, draggable components
Scroll-driven animations using the ScrollTrigger plugin
Sequenced animations where timing and order matter
Animating SVGs, canvas, or things CSS can't handle
Avoid when
Simple hover effects or fades — CSS transitions are enough
You're already using Motion in React or Vue — don't mix animation libraries
Your site has no JavaScript at all

04

How GSAP Compares

GSAP vs Anime.js

GSAP is more powerful for complex timelines and has better performance at scale. Anime.js is lighter (~10kb gzipped) and simpler for basic animations.

GSAP wins at
Complex timelines, performance, plugin ecosystem
Anime.js wins at
Smaller bundle, simpler API for basics
GSAP vs CSS

CSS is simpler and lighter for basic transitions. GSAP wins when you need sequencing, JS-driven logic, or cross-browser consistency.

GSAP wins at
Sequencing, dynamic values, scroll-driven, JS control
CSS wins at
Zero JS, GPU-accelerated by default, simpler syntax
GSAP vs Motion

Motion is declarative and integrates neatly with React, Vue, and vanilla JS. GSAP is more powerful for complex imperative sequences and timelines.

GSAP wins at
Framework-agnostic, imperative control, plugins
Motion wins at
Declarative API, spring physics, layout animations

05

Get Started with GSAP

Terminal
npm install gsap
Terminal
yarn add gsap
HTML
<script src="https://cdn.jsdelivr.net/npm/gsap@3/dist/gsap.min.js"></script>
Quick Start
import { gsap } from "gsap";

// Animate an element
gsap.to(".box", {
  x: 200,
  rotation: 360,
  duration: 1,
  ease: "power2.out"
});

06

Related Libraries