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
Installs just this skill. Get the whole plugin for auto-invocation.
β‘ How it fires
How this skill gets triggered: by you, by Claude, or both.
Fires itselfClaude auto-loads it when your prompt matches the work.
You can call itInvoke it directly when you want it.
Slash command/gsap-timeline
ποΈ Context preview
The summary Claude sees to decide when to auto-load this skill.
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
π Stats
Stars80,930
Forks9,351
LanguageTypeScript
LicenseApache-2.0
π¦ Ships with open-design
</> SKILL.md
gsap-timeline.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).
triggers:
- "gsap timeline"
- "animation timeline"
- "sequenced animation"
- "motion choreography"
license: MIT
od:
mode: prototype
category: animation-motion
upstream: "https://github.com/greensock/gsap-skills"
---# 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 })
- **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.