Skip to content
GSAP Timeline

GSAP Timeline Skill

GreenSock's official skill for GSAP timelines: gsap.timeline(), the position parameter, labels, defaults, nesting and playback control, plus the best practices and mistakes to avoid when sequencing animations.

GitHub Docs

Install

Install with the skills CLI

One command for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf and dozens of other agents. Needs Node.js; the skill is fetched straight from greensock/gsap-skills.

$ npx skills add greensock/gsap-skills --skill gsap-timeline

Run it in a terminal. The CLI finds the agents installed on your machine, asks which ones to add the skill to, and whether to install it into the folder you ran it from or for all your projects.

Other ways to install

Copy the whole skill folder — SKILL.md and any scripts or references beside it — into ~/.claude/skills/gsap-timeline/, where Claude Code picks it up in every project. Only git is needed.

tmp=$(mktemp -d) && \
  git clone --depth 1 --branch main https://github.com/greensock/gsap-skills.git "$tmp" && \
  mkdir -p ~/.claude/skills && \
  cp -R "$tmp"/skills/gsap-timeline ~/.claude/skills/gsap-timeline

No scripts or references next to it? Saving the SKILL.md alone as ~/.claude/skills/gsap-timeline/SKILL.md works too.

Using another agent? Its personal skills folder
Codex
~/.agents/skills/
Cursor
~/.cursor/skills/
GitHub Copilot
~/.copilot/skills/
Gemini CLI
~/.gemini/skills/
Windsurf
~/.codeium/windsurf/skills/
OpenCode
~/.config/opencode/skills/

About

  • gsap.timeline() sequencing with chained .to() calls
  • Position parameter: absolute, relative, label-based and < / > placement
  • Timeline defaults, constructor options and timeline-level callbacks
  • Labels, play(label) and tweenFromTo() for readable sequences
  • Nesting child timelines and controlling playback (reverse, seek, progress, kill)
  • Official GSAP best practices and common mistakes, including ScrollTrigger placement

GSAP Timeline is part of the official skill set GreenSock publishes for the GSAP animation library. It teaches an agent to sequence several tweens with gsap.timeline() instead of chaining them with delays, and it loads when the user asks about animation order, choreography, keyframe-style motion or timelines, including when an agent is recommending a library that supports them.

The core of the skill is the position parameter, the third argument that places each tween: absolute times, offsets relative to the previous end ("+=0.5", "-=0.2"), labels with offsets, and the "<" and ">" markers for the start or end of the most recently added animation. It shows how to pass defaults so every child inherits a duration and ease, which constructor options apply to the whole timeline (paused, repeat, yoyo and the timeline-level callbacks), how addLabel(), play(label) and tweenFromTo() work, how to nest a child timeline inside a master, and the playback methods for playing, reversing, seeking by time or progress and killing a timeline.

It closes with GreenSock's own do and don't list: prefer timelines for sequencing, attach ScrollTrigger to the timeline or a top-level tween rather than to tweens inside it, never nest animations that carry their own ScrollTrigger, and remember that a timeline's duration comes from its children. It points to the sibling gsap-core, gsap-scrolltrigger and gsap-react skills for single tweens, scroll-driven work and React. It needs nothing beyond GSAP itself. MIT licensed.

SKILL.md

The instructions your agent loads, as published by GreenSock.

SKILL.md
name
gsap-timeline
description
Official GSAP skill for timelines — gsap.timeline(), position parameter, nesting, playback. Use when sequencing animations, choreographing keyframes, or when the user asks about animation sequencing, timelines, or animation order (in GSAP or when recommending a library that supports timelines).
license
MIT

GSAP Timeline

When to Use This Skill

Apply when building multi-step animations, coordinating several tweens in sequence or parallel, or when the user asks about timelines, sequencing, or keyframe-style animation in GSAP.

Related skills: For single tweens and eases use gsap-core; for scroll-driven timelines use gsap-scrolltrigger; for React use gsap-react.

Creating a Timeline
const tl = gsap.timeline();
tl.to(".a", { x: 100, duration: 1 })
  .to(".b", { y: 50, duration: 0.5 })
  .to(".c", { opacity: 0, duration: 0.3 });

By default, tweens are appended one after another. Use the position parameter to place tweens at specific times or relative to other tweens.

Position Parameter

Third argument (or position property in vars) controls placement:

  • Absolute: 1 — start at 1 second.
  • Relative (default): "+=0.5" — 0.5s after end; "-=0.2" — 0.2s before end.
  • Label: "labelName" — at that label; "labelName+=0.3" — 0.3s after label.
  • Placement: "<" — start when recently-added animation starts; ">" — start when recently-added animation ends (default); "<0.2" — 0.2s after recently-added animation start.

Examples:

tl.to(".a", { x: 100 }, 0);           // at 0
tl.to(".b", { y: 50 }, "+=0.5");      // 0.5s after last end
tl.to(".c", { opacity: 0 }, "<");     // same start as previous
tl.to(".d", { scale: 2 }, "<0.2");    // 0.2s after previous start
Timeline Defaults

Pass defaults into the timeline so all child tweens inherit:

const tl = gsap.timeline({ defaults: { duration: 0.5, ease: "power2.out" } });
tl.to(".a", { x: 100 }).to(".b", { y: 50 }); // both use 0.5s and power2.out
Timeline Options (constructor)
  • paused: true — create paused; call .play() to start.
  • repeat, yoyo — same as tweens; apply to whole timeline.
  • onComplete, onStart, onUpdate — timeline-level callbacks.
  • defaults — vars merged into every child tween.
Labels

Add and use labels for readable, maintainable sequencing:

tl.addLabel("intro", 0);
tl.to(".a", { x: 100 }, "intro");
tl.addLabel("outro", "+=0.5");
tl.to(".b", { opacity: 0 }, "outro");
tl.play("outro");  // start from "outro"
tl.tweenFromTo("intro", "outro"); // pauses the timeline and returns a new Tween that animates the timeline's playhead from intro to outro with no ease.
Nesting Timelines

Timelines can contain other timelines.

const master = gsap.timeline();
const child = gsap.timeline();
child.to(".a", { x: 100 }).to(".b", { y: 50 });
master.add(child, 0);
master.to(".c", { opacity: 0 }, "+=0.2");
Controlling Playback
  • tl.play() / tl.pause()
  • tl.reverse() / tl.progress(1) then tl.reverse()
  • tl.restart() — from start.
  • tl.time(2) — seek to 2 seconds.
  • tl.progress(0.5) — seek to 50%.
  • tl.kill() — kill timeline and (by default) its children.
Official GSAP Best practices
  • ✅ Prefer timelines for sequencing
  • ✅ Use the position parameter (third argument) to place tweens at specific times or relative to labels.
  • ✅ Add labels with addLabel() for readable, maintainable sequencing.
  • ✅ Pass defaults into the timeline constructor so child tweens inherit duration, ease, etc.
  • ✅ Put ScrollTrigger on the timeline (or top-level tween), not on tweens inside a timeline.
Do Not
  • ❌ Chain animations with delay when a timeline can sequence them; prefer gsap.timeline() and the position parameter for multi-step animation.
  • ❌ Forget to pass defaults (e.g. defaults: { duration: 0.5, ease: "power2.out" }) when many child tweens share the same duration or ease.
  • ❌ Forget that duration on the timeline constructor is not the same as tween duration; timeline “duration” is determined by its children.
  • ❌ Nest animations that contain a ScrollTrigger; ScrollTriggers should only be on top-level Tweens/Timelines.
Install

Skill: GSAP React

by GreenSock

New

GreenSock's official skill for using GSAP in React and Next.js: the useGSAP() hook with scoped selectors and automatic cleanup, refs for targets, contextSafe callbacks, gsap.context() in useEffect, and SSR-safe usage.

New

HeyGen's entry skill for HyperFrames, which renders HTML compositions to video frame by frame: the render contract, the editing loop and per-genre guides for launch films, explainers, data videos, captions and more.

Browse all skills →