GSAP Advanced Web Animation

VerifiedSafe

Practical guide to building JavaScript animations with GSAP: tweens, timelines, ScrollTrigger, SVG, and React. Includes code examples and best practices.

Sby Skills Guide Bot
DevelopmentIntermediate
11/17/2026
Claude CodeCursorWindsurfCopilotCodex
#gsap#animation#scrolltrigger#timeline#svg

Recommended for

Automated summary

A hands-on GSAP guide covering tweens, sequenced timelines, ScrollTrigger scroll-driven animation, React integration with useGSAP and text splitting.

Strengths

  • Clear step-by-step progression from simple tweens to timelines and ScrollTrigger
  • Complete, copy-ready code samples, including React integration with useGSAP and ref scoping
  • Covers advanced plugins (SplitText, MorphSVG, DrawSVG, Flip) and notes they are now free under the Webflow-era license
  • Flags responsive and reduced-motion handling through gsap.matchMedia()

Limitations

  • Assumes an existing JavaScript/React project with npm; no help on initial setup or bundler configuration
  • Animation cleanup and SSR/hydration behavior are not covered outside the React case
  • The text-splitting and matchMedia section is truncated mid-sentence
When to use it

Reach for it when building rich web motion: sequenced timelines, scroll-linked effects, SVG morphing or text animations.

When not to use it

Skip it if you want lightweight pure-CSS animation with no dependency, or if the project has no JavaScript toolchain yet.

Security analysis

Safe
Quality score86/100

The content is purely reference documentation for a well-known animation library. It contains no credential handling, network calls beyond an npm install example, no eval/base64 payloads, and no attempts to override agent instructions or safety rules. All code samples are standard GSAP usage patterns.

Findings
  • •The SKILL.md includes shell snippets (`npm install gsap @gsap/react`), but these are ordinary package-install examples rather than executed actions; no exfiltration, destructive commands, or obfuscation is present.
  • •Minor: `no declared_allowed_tools` yet the document shows bash commands — worth noting only if the platform enforces tool declarations strictly.
How this analysis is made

Examples

Hero entrance timeline
Build a GSAP timeline that animates my hero section on page load: logo scales in, nav links fade with a stagger, then the headline slides in and the CTA pops in at the same time as the headline.
Scroll-pinned horizontal section
Use GSAP ScrollTrigger to pin a horizontal gallery section and scrub its horizontal scroll based on the section width, with smooth scrubbing.
React scroll reveal
Add scroll-triggered reveal animations to my React card grid using useGSAP with a container ref, staggering the cards when the grid hits 80% of the viewport.

name: gsap description: >- GSAP is a JavaScript animation library for tweens, timelines, scroll-driven animation (ScrollTrigger), SVG morphing and text splitting. Use it when building complex timelines, scroll-linked animations, SVG morphing, text animations, or high-performance web animations beyond CSS capabilities. license: Apache-2.0 compatibility: 'Any JavaScript, React, Vue' metadata: author: terminal-skills repository: https://github.com/greensock/GSAP version: 1.1.0 category: development tags: "gsap, animation, scrolltrigger, timeline, svg"

GSAP

Overview

GSAP (GreenSock Animation Platform) is the most powerful web animation library. Handles complex timelines, scroll-driven animations, SVG morphing, text effects, and physics-based motion. Since Webflow's support, GSAP and all its plugins (ScrollTrigger, SplitText, MorphSVG, DrawSVG, Flip and others) are free for everyone, including commercial use, under the Standard "no charge" license (https://gsap.com/standard-license). Checked against gsap 3.15.0 and @gsap/react 2.1.2 on npm (2026-10-24).

Instructions

npm install gsap @gsap/react   # plugins ship inside the gsap package: import from 'gsap/ScrollTrigger', 'gsap/SplitText'

Step 1: Basic Animations

import gsap from 'gsap'

// Animate to
gsap.to('.hero-title', { opacity: 1, y: 0, duration: 1, ease: 'power3.out' })

// Animate from
gsap.from('.card', { opacity: 0, y: 50, duration: 0.8, stagger: 0.15 })

// Set immediately
gsap.set('.hidden-element', { opacity: 0, y: 20 })

Step 2: Timelines

// Sequenced animations — play in order
const tl = gsap.timeline({ defaults: { duration: 0.6, ease: 'power2.out' } })

tl.from('.logo', { scale: 0, rotation: -180 })
  .from('.nav-link', { opacity: 0, y: -20, stagger: 0.1 }, '-=0.3')  // overlap by 0.3s
  .from('.hero-text', { opacity: 0, x: -50 })
  .from('.cta-button', { opacity: 0, scale: 0.8 }, '<')               // start at same time as previous

// Control
tl.play()
tl.reverse()
tl.pause()
tl.seek(1.5)  // jump to 1.5 seconds

Step 3: ScrollTrigger

import { ScrollTrigger } from 'gsap/ScrollTrigger'
gsap.registerPlugin(ScrollTrigger)

// Animate when scrolling into view
gsap.from('.feature-section', {
  scrollTrigger: {
    trigger: '.feature-section',
    start: 'top 80%',        // trigger when top of element hits 80% of viewport
    end: 'bottom 20%',
    toggleActions: 'play none none reverse',  // onEnter, onLeave, onEnterBack, onLeaveBack
  },
  opacity: 0,
  y: 100,
  duration: 1,
})

// Pin section during scroll
gsap.to('.horizontal-section', {
  x: () => -(document.querySelector('.horizontal-section').scrollWidth - window.innerWidth),
  scrollTrigger: {
    trigger: '.horizontal-wrapper',
    pin: true,
    scrub: 1,                // smooth scrubbing (1 second lag)
    end: () => '+=' + document.querySelector('.horizontal-section').scrollWidth,
  },
})

Step 4: React Integration

import { useRef } from 'react'
import { useGSAP } from '@gsap/react'
import gsap from 'gsap'
import { ScrollTrigger } from 'gsap/ScrollTrigger'

gsap.registerPlugin(useGSAP, ScrollTrigger)

function AnimatedSection() {
  const container = useRef(null)

  useGSAP(() => {
    gsap.from('.card', {
      opacity: 0, y: 40, stagger: 0.1, duration: 0.6,
      scrollTrigger: { trigger: container.current, start: 'top 80%' },
    })
  }, { scope: container })

  return (
    <div ref={container}>
      <div className="card">Card 1</div>
      <div className="card">Card 2</div>
      <div className="card">Card 3</div>
    </div>
  )
}

Step 5: Split text, responsive and reduced-motion

SplitText (now free) splits text into chars, words and lines. Create it with SplitText.create, which can re-split on resize via autoSplit and call your animation from onSplit. gsap.matchMedia() runs setup only when a media query matches and reverts it afterwards, which is the clean way to honor prefers-reduced-motion.

import gsap from 'gsap'
import { SplitText } from 'gsap/SplitText'
gsap.registerPlugin(SplitText)

const mm = gsap.matchMedia()

mm.add('(prefers-reduced-motion: no-preference)', () => {
  SplitText.create('.hero-title', {
    type: 'words,lines',
    mask: 'lines',              // wrap lines for a reveal effect
    autoSplit: true,            // re-split when fonts load or width changes
    onSplit(self) {
      return gsap.from(self.lines, { yPercent: 100, stagger: 0.08, duration: 0.8, ease: 'power3.out' })
    },
  })
})

Examples

Example 1: Hero entrance with a timeline

User request: "Make the logo, nav links and CTA animate in one after another when the landing page loads."

Use the Step 2 timeline: gsap.timeline({ defaults: { duration: 0.6, ease: 'power2.out' } }), .from('.logo', ...), .from('.nav-link', ..., '-=0.3') and .from('.cta-button', ..., '<'). Each step starts when the previous one ends, minus the -=0.3 overlap, and '<' starts the CTA together with the previous step. Call tl.restart() to replay.

Example 2: Fade-in sections in a React app

User request: "In my Next.js page, cards should fade up when they scroll into view."

Add 'use client' to the component, register the plugins once (gsap.registerPlugin(useGSAP, ScrollTrigger), as in Step 4), use Step 4's useGSAP with scope: container. Opening the page shows the cards hidden until the section reaches 80% of the viewport, and unmounting reverts the animation.

Guidelines

  • GSAP and every plugin are free, including commercial use; the earlier "Club" paid tiers no longer apply. Read the Standard license for its terms.
  • Register each plugin once with gsap.registerPlugin(...) before using it; with useGSAP register useGSAP too.
  • Respect reduced motion: wrap animations in gsap.matchMedia() as in Step 5.
  • Prefer animating x, y, scale, rotation and opacity (transforms) over layout properties like width or top.
  • In React, create animations inside useGSAP and use contextSafe for event handlers so cleanup works.
  • Use useGSAP hook in React — it handles cleanup automatically on unmount.
  • ScrollTrigger with scrub creates scroll-linked animations (parallax, progress).
  • stagger animates multiple elements sequentially — cleaner than manual delays.
  • Use CSS transitions for simple hover states; reach for GSAP when you need sequencing, scroll linking, or runtime control.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/gsap-advanced-web-animation-mwirmdwo/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/gsap-advanced-web-animation-mwirmdwo' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/gsap-advanced-web-animation-mwirmdwo/download' --output '.skill-downloads/gsap-advanced-web-animation-mwirmdwo/SKILL.md.part' && mv '.skill-downloads/gsap-advanced-web-animation-mwirmdwo/SKILL.md.part' '.skill-downloads/gsap-advanced-web-animation-mwirmdwo/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Environment declared by the author: Any JavaScript, React, Vue

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/gsap-advanced-web-animation-mwirmdwo/SKILL.md' && test -s '.skill-downloads/gsap-advanced-web-animation-mwirmdwo/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/gsap' && cp -R '.skill-downloads/gsap-advanced-web-animation-mwirmdwo' '.claude/skills/gsap'

Cursor
test -f '.skill-downloads/gsap-advanced-web-animation-mwirmdwo/SKILL.md' && test -s '.skill-downloads/gsap-advanced-web-animation-mwirmdwo/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/gsap' && cp -R '.skill-downloads/gsap-advanced-web-animation-mwirmdwo' '.cursor/skills/gsap'

Codex
test -f '.skill-downloads/gsap-advanced-web-animation-mwirmdwo/SKILL.md' && test -s '.skill-downloads/gsap-advanced-web-animation-mwirmdwo/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/gsap' && cp -R '.skill-downloads/gsap-advanced-web-animation-mwirmdwo' '.agents/skills/gsap'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/gsap-advanced-web-animation-mwirmdwo'

openskills read 'gsap-advanced-web-animation-mwirmdwo'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/gsap-advanced-web-animation-mwirmdwo/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills