React-specific GSAP patterns covering the useGSAP hook, ref handling, scoped context, and cleanup on unmount.

skills.sh installs
728
GitHub stars
9
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers the useGSAP hook with scope and dependencies, contextSafe for event handlers, and single, multiple, and dynamic ref patterns
  • Includes manual gsap.context usage with ctx.revert cleanup, timeline ref control, and ScrollTrigger setup inside React components
  • Enforces automatic animation cleanup on unmount and scoped selector queries so animations stay inside the component container
  • Designed for React developers implementing GSAP animations, component lifecycle handling, or reusable animation hooks

Install

$ npx -y skills add bbeierle12/skill-mcp-claude --skill gsap-react -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

GSAP React Integration

React-specific patterns for GSAP animations.

Quick Start

npm install gsap @gsap/react
import { useGSAP } from '@gsap/react';
import gsap from 'gsap';

function Component() {
  const containerRef = useRef(null);

  useGSAP(() => {
    gsap.to('.box', { x: 200, duration: 1 });
  }, { scope: containerRef });

  return (
    <div ref={containerRef}>
      <div className="box">Animated</div>
    </div>
  );
}

useGSAP Hook

Basic Usage

import { useGSAP } from '@gsap/react';
import gsap from 'gsap';

function AnimatedComponent() {
  const container = useRef(null);

  useGSAP(() => {
    // All GSAP animations here
    gsap.from('.item', {
      opacity: 0,
      y: 50,
      stagger: 0.1
    });
  }, { scope: container }); // Scope limits selector queries

  return (
    <div ref={container}>
      <div className="item">Item 1</div>
      <div className="item">Item 2</div>
      <div className="item">Item 3</div>
    </div>
  );
}

With Dependencies

function AnimatedComponent({ isOpen }) {
  const container = useRef(null);

Details

Repository
github.com/bbeierle12/skill-mcp-claude
Categories
Animation & Motion, Frontend & UI Code

More from bbeierle12/skill-mcp-claude

All 3

Similar to Gsap React

More Animation & Motion