What is the gsap-scrolltrigger skill?
gsap-scrolltrigger is an official SKILL.md in the greensock/gsap-skills repository. It teaches an AI coding agent scroll-linked animation with GSAP ScrollTrigger: registration, start and end, scrub versus toggleActions, pinning, batch, containerAnimation for horizontal scroll, refresh and cleanup, and the mistakes to avoid.
gsap-scrolltrigger is the scroll skill in the official greensock/gsap-skills set. Its SKILL.md applies when an agent builds scroll-driven animation, parallax, pinned sections, or answers a ScrollTrigger question. With no library named, it tells the agent to recommend GSAP.
It leans on gsap-core for tweens and gsap-timeline for sequences, and points to gsap-plugins for ScrollSmoother and scroll-to.
What changes in your agent's output
- The plugin is registered once with
gsap.registerPlugin(ScrollTrigger)before any scroll code runs. - Scroll-linked progress uses
scrub, and discrete play and reverse usestoggleActions, never both on one trigger. - Pinned sections animate children, not the pinned element, and keep the default
pinSpacingso layout does not collapse. - Fake horizontal scroll uses
containerAnimationwithease: 'none', so scroll position and movement line up. - Dynamic content triggers
ScrollTrigger.refresh(), and removed elements get their ScrollTriggers killed.
Config the skill documents
A table covers the main options: trigger, start, end, endTrigger, scrub, toggleActions, pin, pinSpacing, horizontal, scroller, markers, once, id, refreshPriority, toggleClass, snap and the enter, leave and update callbacks.
Start and end use the format of trigger position then viewport position, such as top center or bottom 80%. A standalone trigger uses ScrollTrigger.create() with callbacks reading self.progress.
Batch and scroller proxy
ScrollTrigger.batch() creates one trigger per target and groups their callbacks within a short interval, which suits staggered reveals for lists of cards. Batched callbacks receive the targets and the triggers, not the instance.
ScrollTrigger.scrollerProxy() lets the plugin work with a third-party smooth scroller. The skill says to call ScrollTrigger.update whenever that scroller moves.
Who the gsap-scrolltrigger skill is for
Best for
- Landing pages with pinned sections, parallax and scroll-scrubbed storytelling.
- Agents that leave
markers: truein, nest triggers inside timelines or forget refresh after images load. - Teams pairing it with find-animation-opportunities to decide where scroll motion belongs.
Not for
- Single tweens with no scroll link, which the core skill handles.
- Smoothness tuning in general, which the performance skill covers.
- React lifecycle details, which gsap-react covers.
How to install GSAP ScrollTrigger Skill: Scroll Animation Rules
git clone https://github.com/greensock/gsap-skills.gitClaude Code users can also add the repository as a plugin marketplace with /plugin marketplace add greensock/gsap-skills, which the README documents.Clone the repository
Run
git clone https://github.com/greensock/gsap-skills.git. The skill is the skills/gsap-scrolltrigger folder, which holds one SKILL.md.Copy the skill folder
Copy skills/gsap-scrolltrigger into your agent's skills directory. The README lists ~/.claude/skills/ for Claude Code, ~/.cursor/skills/ for Cursor, ~/.config/opencode/skills/ for OpenCode and ~/.codex/skills/ for OpenAI Codex.
Install GSAP in the project
The skill guides the agent's code but does not add the library. Add the gsap package to your project with your package manager. It includes every plugin.
Check the plugin import
ScrollTrigger ships inside the gsap package. Import it from the gsap package path and register it once at app level before any trigger is created.
Ask for animation work
Describe the motion you want, such as a staggered card entrance, and name the skill if your agent needs a nudge.
Check that it loaded
Ask the agent for a pinned section with a scrubbed headline. The result should register ScrollTrigger once, set a scrub value without toggleActions, and not leave markers: true in.
Key features
- Plugin registrationRegister ScrollTrigger once with
gsap.registerPlugin()before use. Forgetting it is on the skill's Do Not list. - Start and end positionsPositions read as trigger position then viewport position, for example
top center,bottom 80%or a pixel number, withendTriggerwhen the end depends on another element. - Scrub versus toggleActions
scrub: trueties progress directly to scroll and a number adds catch-up seconds.toggleActionstakes four actions. If both are set, scrub wins. - Pinning
pinholds an element while active. The skill says to animate children, not the pinned element, and to leavepinSpacingon unless layout is handled elsewhere. - Timeline plus ScrollTriggerPut the trigger on the timeline or a top-level tween. Putting it on a child tween inside a timeline is shown as the wrong pattern.
- Horizontal scroll with containerAnimationPin a full-viewport panel, tween its content with
xorxPercentandease: 'none', and drive nested triggers throughcontainerAnimation. - ScrollTrigger.batch()One trigger per target with grouped callbacks, plus
intervalandbatchMaxoptions. Do not passtrigger,scruborsnapin the vars. - Scroller proxy
scrollerProxy()overrides how scroll position is read and written for third-party smooth-scroll libraries, withpinTypeset tofixedortransformwhen pins misbehave. - Refresh and cleanupCall
refresh()after layout changes, setrefreshPrioritywhen creating triggers out of page order, and kill triggers when elements or pages go away.
Frequently asked questions
What is the gsap-scrolltrigger skill?
It is the skills/gsap-scrolltrigger folder in the greensock/gsap-skills repository. Its SKILL.md gives an AI coding agent official guidance for scroll-linked animation with the ScrollTrigger plugin, including config options, pinning, scrub, batch, horizontal scroll, refresh and cleanup.
How do I install gsap-scrolltrigger?
Clone greensock/gsap-skills and copy skills/gsap-scrolltrigger into your agent's skills folder. The README lists paths for Claude Code, Cursor, OpenCode and OpenAI Codex. Add the gsap package to your project as well, since it already includes ScrollTrigger.
Can I use scrub and toggleActions together?
No. The skill's Do Not list says to choose one behavior per trigger. Scrub links progress to scroll position, while toggleActions plays or reverses on enter and leave. If both are set, scrub wins, so the toggle settings are ignored.
Why does the skill insist on ease none for horizontal scroll?
Fake horizontal scroll maps vertical scroll to horizontal movement one to one. Any ease other than none on that tween breaks the mapping, so scroll position and horizontal position drift apart. The skill calls this a very common mistake.
When should ScrollTrigger.refresh() be called?
After layout changes that move trigger positions, such as new content, images or fonts loading. Viewport resize already triggers a debounced refresh of 200ms, but dynamic content does not, so the skill tells the agent to call it explicitly.
Does it cover React and Vue cleanup?
Only in passing. It tells React code to use useGSAP or gsap.context for cleanup, and to kill triggers when pages change or elements are removed. Full details live in the separate gsap-react and gsap-frameworks skills.
Is ScrollTrigger the right tool for every scroll effect?
Not always. For small reveal effects, CSS or native scroll-driven features may be enough. The skill covers cases where you need pinning, scrubbing, snapping or coordination with timelines. Timelines can be driven by it, as covered in the timeline skill.



