GSAP
Package: gsap | Sections: GSAP Core, Timeline, Tween, Utils, Eases, Helper Functions, Plugins, Guides | Chapters: 411 | Generated: 2026-08-25
How to Use This Skill
- Without arguments — load core patterns for reference
- With a topic — ask about
ScrollTrigger, stagger, Draggable, or another indexed topic; I find and read the relevant chapter
- With a method/plugin name — ask for
gsap.to(), Flip.from(), ch331; I load that specific chapter
- Browse — ask "what chapters do you have?" to see the full index
When you ask about something not covered in Core Patterns below, I will read the relevant chapter file before answering.
Core Patterns & Conventions
Everything is a tween or a timeline. gsap.to(target, {vars}) animates target's properties toward the values in vars from their current state; gsap.from()/gsap.fromTo() control the starting state explicitly; gsap.set() applies values instantly with no animation. A gsap.timeline() is a container that sequences and nests tweens under one controllable playhead — reach for one the moment two or more animations need relative timing.
Targets are flexible. A CSS selector string, a single element, an array/NodeList, or a plain object (for tweening arbitrary JS values) are all valid targets — GSAP resolves selectors via document.querySelectorAll by default, or a scoped selector function from gsap.utils.selector()/gsap.context().
Sequencing uses labels and the position parameter, not hardcoded times. Inside a timeline, the second argument to .to()/.from()/.set() ("+=0.5", "<", "myLabel") places the tween relative to the previous tween or a named label — this keeps sequences resilient when an earlier tween's duration changes. "<" = start of previous tween, ">" = end of previous tween (default).
Plugins must be registered before use. gsap.registerPlugin(ScrollTrigger, Draggable, ...) once per session (per plugin) — using plugin-specific properties without registering silently does nothing. Most plugins ship as separate imports from the gsap/ package (e.g. import { ScrollTrigger } from "gsap/ScrollTrigger"); GSAP core plugins (CSS, Attributes, Snap, Modifiers, EndArray) are bundled and don't need separate registration.
Cleanup in component frameworks uses gsap.context(). Scope all tween/ScrollTrigger creation inside a context tied to a DOM ref, and call context.revert() on unmount — this is the standard, and near-mandatory, pattern in React/Vue/Svelte to avoid leaked tweens and duplicate ScrollTriggers across remounts.
Responsiveness uses gsap.matchMedia(), not manual window.matchMedia + resize listeners — each breakpoint block gets its own setup and automatic cleanup when the breakpoint no longer matches.
Multi-target choreography uses stagger, not manual delay loops — stagger accepts a number (seconds between each target) or an object ({each, from, grid, ease}) for direction- and grid-aware cascades.
ScrollTrigger has two distinct modes: toggleActions (play/pause/resume/reverse on enter/leave the trigger zone) for animations that play once, and scrub (playhead tied directly to scroll position) for parallax/progress-driven motion — these are not interchangeable, pick based on whether the animation should play or track.
Prefer transform properties. x/y/scale/rotation (GPU-accelerated, no layout) over left/top/width/height wherever the visual result is equivalent.
Chapter Index
intro
GSAP Core
Timeline
Tween
Utils
Eases
Helper Functions
Plugins overview
Plugin — CSSRulePlugin
Plugin — Draggable
Plugin — DrawSVG
Plugin — EaselPlugin
Plugin — Flip
Plugin — GSDevTools
Plugin — Inertia
Plugin — MorphSVG
Plugin — MotionPathPlugin
Plugin — MotionPathHelper
Plugin — Observer
Plugin — Physics2D
Plugin — PhysicsPropsPlugin
Plugin — Pixi
Plugin — ScrambleText
Plugin — ScrollSmoother
Plugin — ScrollTo
Plugin — ScrollTrigger
Plugin — SplitText
Plugin — TextPlugin
Guides
Topic Index
- Accessibility → ch390
- CustomEase / custom easing → ch152, ch396
- Draggable → ch190–ch232
- Easing → ch150, ch396, ch024, ch027
- Flip (layout animation) → ch237–ch245, ch167
- Framework cleanup (React/Vue/Svelte) → ch009 (gsap.context), ch393, ch405–ch407
- Inertia / physics → ch248–ch262, ch308, ch309
- Keyframes → ch400
- Labels → ch039, ch061, ch403
- matchMedia / responsive → ch022, ch023
- Migration from GSAP 2 → ch389
- MorphSVG → ch263–ch269
- MotionPathPlugin → ch270–ch285
- Observer → ch286–ch307
- Performance (quickTo/quickSetter) → ch025, ch026
- Pin (ScrollTrigger) → ch343
- Position parameter → ch403
- Scrub vs toggleActions → ch331, ch343, ch396–ch398
- ScrollSmoother → ch313–ch328
- ScrollTrigger → ch331–ch376, ch408
- SplitText → ch377–ch387
- Stagger → ch397, ch135
- Timeline sequencing → ch037–ch096, ch398
- Utility methods (clamp, mapRange, wrap, snap...) → ch132–ch149
- Webflow / WordPress integration → ch410, ch411
Supporting Files
Scope & Limits
This skill covers the official GSAP v3 documentation (core API, Tween/Timeline instances, utility methods, easing, and every officially maintained plugin) as of the fetch date. GSAP became 100% free (MIT) in 2024 — no license-gated features remain, though CSSRulePlugin is marked deprecated by GreenSock in favor of native CSS custom properties. For implementation details specific to a codebase, combine with project-specific tools.