GSAP PlaygroundGetting Startedgsap.to()
0/55 lessons
Getting Startedgsap.to()
gsap.to() animates an element from its current state to the values you specify. The first argument is a CSS selector or DOM element. The second is a vars object with target values and a duration in seconds. Edit the values and watch the box move.
Editor
Preview
Console
1 / 55

GSAP Playground — Learn Web Animation from Tweens to ScrollTrigger

A free interactive GSAP playground with 55 guided lessons across 18 chapters, a live JavaScript editor, instant visual preview, and a Replay button. Learn gsap.to(), timelines, stagger, ScrollTrigger, keyframes, gsap.utils, responsive animation, official GSAP plugins, and real animation patterns with no install and no setup.

Updated June 3, 2026
Share & Support

What You Can Practice

Live GSAP editor
Write GSAP code and see animations play instantly. The preview auto-updates as you type, with a 400ms debounce so the animation waits for you to stop.
Replay button
Click Replay at any time to kill all running tweens, reset element styles, and re-execute your code from the start.
Pre-built demo elements
Boxes, heading, subtitle, button, cards, and a scroll section are always available in the preview — just target them with GSAP selectors.
55 structured lessons
From gsap.to() basics through timelines, stagger, ScrollTrigger, keyframes, gsap.utils, responsive animation, official plugins, and real UI animation patterns.
Official plugin bundle
Draggable, Observer, SplitText, TextPlugin, ScrambleText, DrawSVG, MorphSVG, Inertia, physics plugins, helpers, and renderer plugins are available from local GSAP files.
Progress saved locally
Completed lessons are saved in localStorage. No account needed — return to the same lesson later.

About this tool

Learn GSAP by Writing Code and Watching Animations Play

GSAP (GreenSock Animation Platform) is the industry-standard JavaScript animation library — used by Google, Nike, Awwwards winners, and countless production websites. It's fast, reliable, and works in every browser. But learning it by reading documentation alone is slow because the key insight is seeing what each property and method does, not just understanding the syntax.

This GSAP Playground puts a live code editor next to a visual preview. Write gsap.to(".box", { x: 200 }), watch the box move, edit the duration, change the ease, add a second tween, build a timeline — and see every change play out immediately. A Replay button resets all animations and runs your code from the beginning whenever you want to watch it again.

The 55 structured lessons are organized into 18 chapters. Each lesson starts with a concept explanation, loads a working code example into the editor, and gives you pre-built demo elements to animate against. Picker lessons show multiple variants of the same concept so you can compare ease types, stagger directions, position parameters, utility helpers, responsive patterns, or plugin workflows by switching between them without rewriting code.

What the GSAP Lessons Cover

ChapterLessonsWhat You Learn
Getting Started4 lessonsgsap.to(), gsap.from(), gsap.fromTo(), duration and delay.
Properties4 lessonsx/y transform, rotation, scale, opacity, autoAlpha, and animating CSS properties and colours.
Easing3 lessonsPower eases (in/out/inOut), bounce, elastic, back, steps, and linear.
Timelines4 lessonsgsap.timeline(), position parameter (<, -=, +=), defaults, and play/pause/reverse/restart controls.
Stagger2 lessonsBasic stagger timing and stagger from (start, end, center).
Repeat & Yoyo2 lessonsrepeat, repeatDelay, and yoyo for looping and ping-pong animations.
Callbacks2 lessonsonComplete, onStart, and onUpdate — reading tween progress in real time.
ScrollTrigger4 lessonstrigger and toggleActions, toggleClass, scrub for scroll-linked animation, and pin for scroll-driven storytelling.
Keyframes2 lessonsArray keyframes for sequential states and percent keyframes for CSS-@keyframes-style control.
Real Patterns4 lessonsCard reveal, hero entrance, pulsing loader, and animated number counter.
GSAP Utils2 lessonsgsap.utils helpers for mapping, clamping, wrapping, interpolation, arrays, and reusable animation utilities.
Responsive2 lessonsmatchMedia patterns, reduced motion handling, and responsive animation changes.
Plugins5 lessonsAll-plugin availability plus CustomEase, ScrollToPlugin, MotionPathPlugin, and Flip workflows.
Interaction Plugins3 lessonsDraggable, Observer, and InertiaPlugin for pointer, gesture, and momentum interactions.
Text Plugins3 lessonsSplitText, TextPlugin, and ScrambleTextPlugin for kinetic text and typewriter effects.
SVG Plugins3 lessonsDrawSVGPlugin, MorphSVGPlugin, and CSSRulePlugin for SVG and pseudo-element animation.
Physics & Ease Plugins3 lessonsCustomBounce, CustomWiggle, Physics2DPlugin, PhysicsPropsPlugin, and EasePack.
Helper & Integration Plugins3 lessonsScrollSmoother, MotionPathHelper, GSDevTools, PixiPlugin, and EaselPlugin usage patterns.

Why GSAP Is Worth Learning

CSS transitions and CSS animations handle simple state changes well. But when animations need to be sequenced, controlled by user input, driven by scroll position, synced to data, or reversed programmatically, CSS becomes difficult to manage. GSAP was built exactly for these situations.

A GSAP timeline lets you chain 10 animations and control the entire sequence with one .play() or .reverse() call. ScrollTrigger links any animation to scroll position with two lines of configuration. The stagger system turns one tween call into a cascading animation across dozens of elements. These are things that would require significant custom JavaScript to replicate in CSS.

GSAP is also consistent across browsers and handles edge cases that trip up CSS transitions — such as animating from a partially-completed state, reversing mid-tween, or compositing multiple transform properties. Once you understand the core methods (to, from, fromTo, timeline, stagger) you can read almost any GSAP code and quickly produce production-quality animation.

Learning here gives you a fast feedback loop: write the code, hit Replay, adjust a number, Replay again. That iteration speed makes the relationship between code and motion intuitive in a way that reading the GSAP documentation alone cannot replicate.

How to Use the GSAP Playground

  1. 1
    Start with gsap.to()The first lesson is intentionally small. Change the x value, change the duration, add a second property — watch each edit play out.
  2. 2
    Use the Replay button freelyGSAP animations play once by default. Click Replay whenever you want to watch the animation from the beginning without reloading the page.
  3. 3
    Switch between Picker variantsEase and position parameter lessons show multiple options. Click each variant to load that code and see exactly how power2.in differs from power2.out.
  4. 4
    Scroll in the preview for ScrollTrigger lessonsScrollTrigger lessons target #scroll-box below the main demo area. Scroll down inside the preview pane to trigger, scrub, or pin the animation.
  5. 5
    Edit the demo elements freelyThe pre-built .box, .heading, .subtitle, .btn, and .card elements are just starting points. Target them differently, add more tweens, or modify properties not in the lesson.
  6. 6
    Apply the Real Patterns to your own projectsThe final chapter covers card reveal, hero entrance, pulsing loader, and animated counter. These are ready to copy and adapt — just change the selectors and values to match your markup.

Who This GSAP Playground Is For

🎬
JavaScript developers new to GSAP
If you know basic JavaScript but have never written a GSAP animation, the Getting Started chapter gets you moving elements in minutes.
🎨
Designers who write code
Experiment with ease types, stagger timing, and timeline sequencing to build intuition for motion design before putting it into a project.
⚛️
React developers adding animation
Learn GSAP fundamentals here, then apply them in React using useRef and useEffect — the same core API works in any framework.
📜
Scroll animation learners
The ScrollTrigger chapter teaches trigger, scrub, and pin — the three most useful scroll animation tools for portfolio and marketing sites.
🚀
Developers polishing UIs
Pick up card reveal, stagger, and timeline patterns quickly and drop them into production-ready components.
🏫
Teachers and workshop instructors
Load a lesson, explain the concept, edit a value live, and hit Replay. Students see the animation change in real time.
Suggested Learning Order

If you are new to JavaScript, start with the JavaScript Playground to get comfortable with functions, objects, and callbacks. Then use this GSAP Playground to learn animation. After GSAP, the React Playground shows how to integrate animation into component-based UIs using useRef and useEffect with GSAP's context cleanup.

Frequently Asked Questions

No. The playground loads GSAP and official plugin files from the local project bundle inside a sandboxed iframe. You write animation code and see the result instantly — no Node.js, npm, CDN request, or build step required.

The 55 lessons cover gsap.to(), gsap.from(), gsap.fromTo(), duration, delay, x/y, rotation, scale, opacity, CSS properties, eases, timelines, stagger, callbacks, ScrollTrigger, keyframes, real animation patterns, gsap.utils, responsive animation, reduced motion, and official plugin workflows across interaction, text, SVG, physics, helper, and renderer categories.

The playground loads GSAP 3 from the installed package, with official plugin files copied into the local public bundle. Available plugin globals are registered automatically before lesson code runs.

Click the green Replay button in the preview pane. It kills all current GSAP tweens, clears inline styles from the demo elements, and re-executes your code from scratch.

Yes. Clear the editor and write anything. The pre-built elements (.box, .heading, .subtitle, .btn, .card, #scroll-box) are always present in the preview as animation targets.

No. GSAP made the formerly Club-only plugins free, and this playground now includes official plugin files from the installed GSAP package, including MorphSVG, SplitText, DrawSVG, Draggable, ScrollSmoother, InertiaPlugin, and more.

Basic JavaScript helps — understanding variables, functions, objects, and arrow functions makes the lessons easier. GSAP itself is approachable, but the callbacks and method chaining in the later chapters assume some comfort with JavaScript.

The preview iframe has a scroll zone below the main demo elements. Scroll down inside the preview pane to activate the ScrollTrigger. For scrub lessons, scroll slowly to drive the animation frame by frame.