PluginBench
Skill
Pass
Audit score 90

gsap-performance

nexu-io/open-design

Optimize GSAP animations for smooth 60fps by preferring transforms, avoiding layout thrashing, and batching updates.

What is gsap-performance?

Official GSAP skill for animation performance optimization. Use when reducing jank, targeting 60fps, or implementing best practices for smooth animations with GSAP. Covers transform/opacity preference, will-change usage, batching, stagger, quickTo, and ScrollTrigger performance.

  • Prefer animating transform (x, y, scale, rotation) and opacity to keep work on the compositor and avoid layout thrashing
  • Use will-change CSS hint on elements that animate to promote browser layers
  • Batch DOM reads and writes to avoid interleaving that causes layout thrashing
  • Apply stagger for efficient multi-element animations instead of manual delays or separate tweens
  • Use gsap.quickTo() for frequently updated properties like mouse followers to reuse a single tween
  • Optimize ScrollTrigger performance by pinning only what's needed, debouncing refresh(), and testing scrub values on low-end devices

How to install gsap-performance

npx skills add https://github.com/nexu-io/open-design --skill gsap-performance
Prerequisites
  • GSAP library installed (gsap-core skill recommended)
  • Basic understanding of CSS transforms and the compositor
  • Familiarity with GSAP tweens and timelines
Claude Code
Cursor
Windsurf
Cline

How to use gsap-performance

  1. 1.Identify animations currently using layout-heavy properties (width, height, top, left, margin, padding)
  2. 2.Replace movement animations with transform-based properties: use x/y instead of left/top, scale instead of width/height
  3. 3.Add will-change: transform to CSS for elements being animated
  4. 4.For multi-element animations, use stagger parameter instead of creating separate tweens with manual delays
  5. 5.For frequently updated properties (e.g., mouse tracking), replace repeated tween creation with gsap.quickTo()
  6. 6.When using ScrollTrigger, pin only necessary elements, debounce refresh() calls, and test scrub values on low-end devices
  7. 7.Clean up or kill off-screen animations to prevent unnecessary processing

Use cases

Good for
  • Reducing animation jank and frame drops in complex interactive UIs
  • Optimizing mouse-follower or cursor-tracking animations with frequent updates
  • Animating large lists or many elements efficiently using stagger instead of individual tweens
  • Improving scroll-linked animation performance with ScrollTrigger by minimizing simultaneous work
  • Converting layout-heavy animations (width, height, top, left) to transform-based equivalents for better performance
Who it's for
  • Front-end developers optimizing animation performance
  • Web developers targeting 60fps on low-end devices
  • Designers and developers using GSAP for interactive motion
  • Performance-conscious teams building scroll-triggered or gesture-based animations

gsap-performance FAQ

When should I use will-change?

Use will-change: transform in CSS only on elements that are actually animating. Setting it on every element 'just in case' wastes browser resources and can hurt performance.

Why should I prefer x/y over left/top?

GSAP's x and y properties use CSS transforms (translate), which are handled by the compositor and avoid layout recalculations. left/top trigger layout thrashing and paint, causing jank.

What is gsap.quickTo() and when should I use it?

gsap.quickTo() reuses a single tween for frequently updated properties instead of creating new tweens on each update. Use it for mouse followers, cursor tracking, or any property updated many times per second.

How do I optimize ScrollTrigger performance?

Pin only elements that need pinning, call ScrollTrigger.refresh() only when layout actually changes (debounced on resize), use small scrub values, and test on low-end devices to ensure smooth scrolling.

Should I create many simultaneous tweens for a list of elements?

No. Use stagger for the same animation across many elements, or consider virtualization to animate only visible items. Hundreds of simultaneous tweens can cause jank on low-end devices.

Full instructions (SKILL.md)

Source of truth, from nexu-io/open-design.


name: gsap-performance description: | Official GSAP skill for performance — prefer transforms, avoid layout thrashing, will-change, batching. Use when optimizing GSAP animations, reducing jank, or when the user asks about animation performance, FPS, or smooth 60fps. triggers:

  • "gsap performance"
  • "animation jank"
  • "60fps animation"
  • "will-change"
  • "layout thrashing" license: MIT od: mode: prototype category: animation-motion upstream: "https://github.com/greensock/gsap-skills"

GSAP Performance

Curated from GreenSock's official GSAP skills: https://github.com/greensock/gsap-skills

When to Use This Skill

Apply when optimizing GSAP animations for smooth 60fps, reducing layout/paint cost, or when the user asks about performance, jank, or best practices for fast animations.

Related skills: Build animations with gsap-core (transforms, autoAlpha) and gsap-timeline; for ScrollTrigger performance see gsap-scrolltrigger.

Prefer Transform and Opacity

Animating transform (x, y, scaleX, scaleY, rotation, rotationX, rotationY, skewX, skewY) and opacity keeps work on the compositor and avoids layout and most paint. Avoid animating layout-heavy properties when a transform can achieve the same effect.

  • ✅ Prefer: x, y, scale, rotation, opacity.
  • ❌ Avoid when possible: width, height, top, left, margin, padding (they trigger layout and can cause jank).

GSAP’s x and y use transforms (translate) by default; use them instead of left/top for movement.

will-change

Use will-change in CSS on elements that will animate. It hints the browser to promote the layer.

will-change: transform;

Batch Reads and Writes

GSAP batches updates internally. When mixing GSAP with direct DOM reads/writes or layout-dependent code, avoid interleaving reads and writes in a way that causes repeated layout thrashing. Prefer doing all reads first, then all writes (or let GSAP handle the writes in one go).

Many Elements (Stagger, Lists)

  • Use stagger instead of many separate tweens with manual delays when the animation is the same; it’s more efficient.
  • For long lists, consider virtualization or animating only visible items; avoid creating hundreds of simultaneous tweens if it causes jank.
  • Reuse timelines where possible; avoid creating new timelines every frame.

Frequently updated properties (e.g. mouse followers)

Prefer gsap.quickTo() for properties that are updated often (e.g. mouse-follower x/y). It reuses a single tween instead of creating new tweens on each update.

let xTo = gsap.quickTo("#id", "x", { duration: 0.4, ease: "power3" }),
    yTo = gsap.quickTo("#id", "y", { duration: 0.4, ease: "power3" });

document.querySelector("#container").addEventListener("mousemove", (e) => {
  xTo(e.pageX);
  yTo(e.pageY);
});

ScrollTrigger and Performance

  • pin: true promotes the pinned element; pin only what’s needed.
  • scrub with a small value (e.g. scrub: 1) can reduce work during scroll; test on low-end devices.
  • Call ScrollTrigger.refresh() only when layout actually changes (e.g. after content load), not on every resize; debounce when possible.

Reduce Simultaneous Work

  • Pause or kill off-screen or inactive animations when they’re not visible (e.g. when the user navigates away).
  • Avoid animating huge numbers of properties on many elements at once; simplify or sequence if needed.

Best practices

  • ✅ Animate transform and opacity; use will-change in CSS only on elements that animate.
  • ✅ Use stagger instead of many separate tweens with manual delays when the animation is the same.
  • ✅ Use gsap.quickTo() for frequently updated properties (e.g. mouse followers).
  • ✅ Clean up or kill off-screen animations; call ScrollTrigger.refresh() when layout changes, debounced when possible.

Do Not

  • ❌ Animate width/ height/ top/ left for movement when x/ y/ scale can achieve the same look.
  • ❌ Set will-change or force3D on every element “just in case”; use for elements that are actually animating.
  • ❌ Create hundreds of overlapping tweens or ScrollTriggers without testing on low-end devices.
  • ❌ Ignore cleanup; stray tweens and ScrollTriggers keep running and can hurt performance and correctness.