Gsap Timeline
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).
Get the complete skill folder, including its scripts and reference files.
When to use this skill
Use Gsap Timeline when an AI agent needs a reusable SKILL.md workflow for this job: 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).
When not to use it
Skip Gsap Timeline when the task is outside the creativity category, or when a more specific skill in this directory already covers the same workflow with clearer triggers.
How to install
Where will you use it?
mkdir -p ~/.claude/skills/gsap-timeline # Save SKILL.md to ~/.claude/skills/gsap-timeline/SKILL.md
- Claude Code personal install: place the skill and its bundled files at ~/.claude/skills/gsap-timeline/SKILL.md. For a shared project, commit the folder at .claude/skills/gsap-timeline/ instead.
- Current Claude Code detects SKILL.md changes in watched directories during the session. If you just created a top-level skills directory, run /reload-skills. Check that the skill is listed before testing its trigger.
- For Claude chat or Cowork in the Desktop app, manage uploaded skills in Customize > Skills; copying files into a local Claude Code folder is not a Desktop install. Other agents may use different install locations.
Full install guide for Claude, Cursor, and Codex →
Try a starter prompt
After installing the skill, paste this starter prompt into your agent to verify it triggers on a small task.
Use the Gsap Timeline skill for this task: Use Gsap Timeline when this documented workflow matches the task. Confirm any required inputs or files before making changes.
What supports this recommendation?
70/100 provisional content score. This measures documentation, practical detail and source signals. It is not a measured task success rate or a security certification.
- Documentation
- 77/100
- Practical detail
- 68/100
- Source evidence
- 57/100
- Source signals
- 72/100
Model compatibility evidence
- claudeuntested
No model-specific signal or recorded compatibility test was found.
- chatgptuntested
No model-specific signal or recorded compatibility test was found.
- geminiuntested
No model-specific signal or recorded compatibility test was found.
- copilotuntested
No model-specific signal or recorded compatibility test was found.
- llamauntested
No model-specific signal or recorded compatibility test was found.
- perplexityuntested
No model-specific signal or recorded compatibility test was found.
- mistraluntested
No model-specific signal or recorded compatibility test was found.
- grokuntested
No model-specific signal or recorded compatibility test was found.
Inferred compatibility is based on content signals. Check the app, its available tools and setup requirements before running a skill.
What this skill does
<!-- pi-phone: added (third_party/open-design/README.md) --> > In pi-phone: in a self-contained HTML artifact, load GSAP from a CDN at a pinned version > (https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js, plugins from the same `dist/` folder, > as `<Plugin>.min.js`), publish with the `artifact` tool, honour `prefers-reduced-motion`, and check the page with > the `screenshot` tool.
# GSAP Timeline
> Curated from GreenSock's official GSAP skills: https://github.com/greensock/gsap-skills
## 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
```javascript 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:
```javascript 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:
```javascript 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:
```javascript 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.
```javascript 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.
Intended uses
- Use Gsap Timeline when this documented workflow matches the task.
Implementation notes
- Review the source instructions and adapt inputs before running the workflow.
Try it, then tell us how it went
A copied prompt does not tell us whether the task worked. Report your result after checking the output. We collect your tool and outcome, never your files or prompt.