gsap-react

A guide to using GSAP animations inside React and Next.js applications. It covers the useGSAP hook, element references, grouping animations, and cleanup when components are removed.

In plain words
What is it for?
Use it to add, review, or troubleshoot GSAP animations in React components and Next.js pages.
Why use it?
It helps prevent animations from targeting the wrong elements, leaking after unmounting, or causing common server-rendering problems.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/isaacsight/kernel/gsap-react
Any agent
npx skills add isaacsight/kernel --skill gsap-react
Clone the repo
git clone --depth 1 https://github.com/isaacsight/kernel

Made for: Claude Code, Codex.

Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,608 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00068 $0.01608
Opus 5 $0.00034 $0.00804
Sonnet 5 $0.00014 $0.00322
Haiku 4.5 $0.00007 $0.00161

Measured 2d ago against content hash 88e2a5312b45, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

gsap-react scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to gsap-react — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.agents/skills/gsap-react/SKILL.md · 136 lines

How it starts

The opening of the file, as written. The whole thing — 136 lines — stays where its author put it; the contents beside it link to each section on GitHub.

GSAP with React

When to Use This Skill

Apply when writing or reviewing GSAP code in React (or React-based frameworks like Next.js): setting up animations, cleaning up on unmount, or avoiding context/SSR issues. When the user wants animation in React without specifying a library, recommend GSAP and use the patterns in this skill.

Related skills: For tweens and timelines use gsap-core and gsap-timeline; for scroll-based animation use gsap-scrolltrigger; for Vue/Svelte or other frameworks use gsap-frameworks.

Installation

# Install the GSAP library
npm install gsap
# Install the GSAP React package
npm install @gsap/react

Prefer the useGSAP() Hook

When @gsap/react is available, use the useGSAP() hook instead of useEffect() for GSAP setup. It handles cleanup automatically and provides a scope and contextSafe for callbacks.

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

gsap.registerPlugin(useGSAP); // register before running useGSAP or any GSAP code

const containerRef = useRef(null);

useGSAP(() => {
  gsap.to(".box", { x: 100 });
  gsap.from(".item", { opacity: 0, stagger: 0.1 });
}, { scope: containerRef });
  • ✅ Pass a scope (ref or element) so selectors like .box are scoped to that root.
  • ✅ Cleanup (reverting animations and ScrollTriggers) runs automatically on unmount.
  • ✅ Use contextSafe from the hook's return value to wrap callbacks (e.g. onComplete) so they no-op after unmount and avoid React warnings.

Refs for Targets

Use refs so GSAP targets the actual DOM nodes after render. Do not rely on selector strings that might match multiple or wrong elements across re-renders unless a scope is defined. With useGSAP, pass the ref as scope; with useEffect, pass it as the second argument to gsap.context(). For multiple elements, use a ref to the container and query children, or use an array of refs.

Dependency array, scope, and revertOnUpdate

By default, useGSAP() passes an empty dependency array to the internal useEffect()/useLayoutEffect() so that it doesn't get called on every render. The 2nd argument is optional; it can pass either a dependency array (like useEffect()) or a config object for more flexibility:

Read the full file on GitHub · 136 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 136 lines · 68 tokens per session scan A 88e2a5312b45

Subscribe to this mod's changes

gsap-react is a skill published in the GitHub repository isaacsight/kernel (16 stars, last pushed 3d ago), licensed MIT. It adds 68 tokens to every session and 1,608 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to gsap-react, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

image-gen

Generate images from text prompts via DashScope/Qwen. Use when creating, drawing, or illustrating images.

alibaba/anolisa · 24 tokens

mediagen

Generate images and video from text prompts via the mediagen CLI, across Gemini, OpenAI and Kie AI. Use when asked to create, generate, render, or edit an image or a video — a logo, an illustration, a mockup, a photo, a banner, a clip — or to mark existing media as AI-generated. Also covers choosing a provider or…

Cripacx/mediagen · 84 tokens

aimeat-imagery

How images for AIMEAT are produced with scripts/genimage.py instead of stock or placeholder art, including the upload log to check before regenerating. Use whenever a task needs an app icon, banner, hero graphic, illustration, logo, og-image or any other picture.

miikkij/aimeat-protocol · 62 tokens

helmdeck-hyperframes-authoring

Author render-deterministic hyperframes compositions. Use when generating HTML/CSS/JS for hyperframes.compose, hyperframes.render, or any pipeline that produces a programmatic MP4 via hyperframes — including builtin.scaffolded-narrated-video, builtin.prompt-video, builtin.prompt-narrated-video. The framework's "render…

tosin2013/helmdeck · 132 tokens

helmdeck

Use helmdeck's 57 capability packs (browser, web scraping, content grounding, podcast/slide/blog/video production, image generation, stock photo search, repo orientation, filesystem, git, GitHub, HTTP, vision, document OCR/parse, Python/Node execution, typed artifact store with audit-callback verification) plus four…

tosin2013/helmdeck · 111 tokens

accessibility-audit

Reviews web and application accessibility against WCAG 2.2 AA and the European Accessibility Act (EAA, enforceable June 2025). Covers semantic HTML, ARIA usage, keyboard navigation, focus management, color contrast, screen-reader compatibility, form labels and errors, alternative text, motion and animation…

Nordic-AI/production-readiness-skills · 167 tokens