scaffold-gsap-scrolltrigger

Generates memory-safe React TSX component scaffolds with GSAP ScrollTrigger animations.

Updated Feb 24, 2026
One-click install
npx skills add https://github.com/marketiv-id/marketiv-web --skill scaffold-gsap-scrolltrigger-marketiv-id
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scaffold-gsap-scrolltrigger
Source: https://github.com/marketiv-id/marketiv-web/tree/main/.github/skills/scaffold-gsap-scrolltrigger
Command: npx skills add https://github.com/marketiv-id/marketiv-web --skill scaffold-gsap-scrolltrigger-marketiv-id

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gsap, @gsap/react.

What problem does it solve? Writing GSAP ScrollTrigger animations in React often leads to memory leaks, double-invoked animations under React Strict Mode, and selector collisions between components. This Skill produces a ready-to-use Next.js App Router component scaffold that follows the correct useGSAP pattern with scoped selectors, eliminating these common pitfalls. ## Core Features & Use Cases - Memory-Safe Scaffold: Generates a .tsx component using useGSAP with containerRef scoping instead of raw useEffect/useLayoutEffect, preventing leaks and Strict Mode issues. - ScrollTrigger Timeline Template: Includes a working ScrollTrigger timeline with markers: false, staggered .reveal-item elements, and editable placeholders for animation config. - Lenis Compatibility: Detects Lenis smooth scroll integration and notes that ScrollTrigger must follow the active Lenis provider without duplicating setup. - Use Case: Ask for a new scroll-animated section for your Next.js landing page and receive a complete, copy-paste-ready TSX component with a heading and three staggered reveal items. ## Quick Start Generate a GSAP ScrollTrigger component named HeroSection with a scroll-based stagger reveal animation.

Frequently Asked Questions about scaffold-gsap-scrolltrigger

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use GSAP ScrollTrigger in a React component?

Use the useGSAP hook from @gsap/react with a containerRef scope instead of useEffect. Register ScrollTrigger outside the component with gsap.registerPlugin(ScrollTrigger), then define your timeline inside useGSAP with scoped selectors.

How to prevent GSAP animations from breaking in React Strict Mode?

React Strict Mode double-invokes effects, causing duplicated GSAP animations. The useGSAP hook handles cleanup automatically, and scoping animations to a containerRef prevents selector collisions between component instances.

Does GSAP ScrollTrigger work with Next.js App Router?

Yes, but the component must be a client component with "use client" at the top of the file. GSAP relies on browser APIs, so it cannot run in server components.

Can I use GSAP ScrollTrigger with Lenis smooth scroll?

Yes, ScrollTrigger works with Lenis as long as it follows the active Lenis provider setup. The scaffold adds a note about this integration without duplicating the provider configuration.

When should I avoid ScrollTrigger for animations?

Avoid ScrollTrigger for simple hover or tap interactions that do not depend on scroll position. A plain GSAP animation without scroll triggers is simpler and more appropriate for those cases.