gsap-nextjs
Skill5 starsChanged 2 months agoMITView on GitHub
Build or review GSAP animation in Next.js App Router projects: page transitions, enter and exit motion, animated show and hide of conditional content, and scroll-driven effects. Use whenever a Next.js App Router project needs any of these, even if GSAP is not named, and whenever layout jank, interrupted animations, or cleanup matter. Also use to choose between GSAP and React View Transitions for a navigation effect. Not for Pages Router, non-Next.js sites, or isolated GSAP API questions.
2 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- johnpolacek/animaxxing-skillsedited, first seen Nov 1, 2026
- johnpolacek/animaxxingword for word, first seen Sep 5, 2026
Other versions2 projects use a version of this.
Word for word · 1
- johnpolacek/animaxxing★ 4100% same
Edited · 1
- johnpolacek/animaxxing-skills★ 2231% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository57 other files it gives its agents.
- adversarial-reviewSkill
- aesthetic-animaxxingSkill
- ai-search-optimizationSkill
- announceSkill
- audio-trackSkill
- blindspotSkill
- brave-wesSkill
- chrome-wesSkill
- clihubSkill
- dashclaw-governanceSkill
- deskclawSkill
- de-vibeSkill
- dispatch-blocksSkill
- epic-infographicsSkill
- fable-gptSkill
- frontend-verifySkill
- gsap-astroSkill
- gsap-coreSkill
- gsap-frameworksSkill
- gsap-nuxtSkill
- gsap-performanceSkill
- gsap-pluginsSkill
- gsap-react-routerSkill
- gsap-reactSkill
- gsap-scrolltriggerSkill
- gsap-sveltekitSkill
- gsap-tanstack-routerSkill
- gsap-timelineSkill
- gsap-utilsSkill
- gsap-vanillaSkill
- harness-healthSkill
- iphoneSkill
- landing-page-cro-expertSkill
- launchSkill
- launch-videoSkill
- logo-revealSkill
- marketingSkill
- marketing-studioSkill
- meditateSkill
- moleresearchSkill
- og-assetsSkill
- petstoreSkill
- phone-gotchasSkill
- phoneSkill
- preflightSkill
- product-demoSkill
- ship-itSkill
- shipSkill
- show-meSkill
- skillfindSkill
- social-clipSkill
- spec-probeSkill
- teamSkill
- tregSkill
- wes-voiceSkill
- wrapSkill
- xplainerSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 11 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Every animated page or component runs through the same lifecycle:
- Very specific: line 17
If the Next config has cacheComponents on, the router hides old routes instead of unmounting them.
- Distinctive: line 21
Read repository instructions and the current code.
- Very specific: line 23
Read the installed Next.js version.
- Very specific: line 24
Check the Next config for cacheComponents.
- Distinctive: line 25
Look at layouts, navigation components, global CSS, accessibility conventions, tests, and any animation library already in use.
- Distinctive: line 26
Keep the project's package manager, language, file layout, styling, and component conventions.
- Very specific: line 28
Add GSAP, @gsap/react, or a plugin only when the requested motion needs it.
- Distinctive: line 42
Use GSAP when the effect needs:
- Distinctive: line 59
Before calling work done: Verification.
- Distinctive: line 81
Keep outgoing pages and components mounted and visible through outro and end state.
- Distinctive: line 84
When outgoing and incoming content overlap, only the stable wrapper takes up space in the layout.
- Distinctive: line 85
Keep native link behavior, focus, scroll, and no-JavaScript readability.
- Very specific: line 88
Prefer transforms and autoAlpha.
- Distinctive: line 89
Use timelines for sequences.
- Distinctive: line 90
Verify in a real browser when practical.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GSAP Next.js
Every animated page or component runs through the same lifecycle:
mount → initial state → intro → settled → outro → end state → unmount
Mount and unmount belong to React. The five phases between them belong to your animation code and happen while the node exists. This skill covers getting those phases right: stable layout, navigation timing, interruptions, and cleanup. The user's request and the existing design decide how things look.
If the Next config has cacheComponents on, the router hides old routes instead of unmounting them. Treat hide as unmount and re-show as mount. See Route lifetime under cacheComponents.
Start with the project
- Read repository instructions and the current code.
- Confirm the App Router. If the project uses the Pages Router, say this skill does not cover it and stop.
- Read the installed Next.js version. Prefer its bundled docs in
node_modules/next/dist/docs/over memory. Version gates:onNavigateanduseLinkStatus(15.3),<ViewTransition>andtransitionTypes(16.2),<Activity>route preservation whencacheComponentsis enabled (16.0, opt-in). - Check the Next config for
cacheComponents. It changes how long routes live. - Look at layouts, navigation components, global CSS, accessibility conventions, tests, and any animation library already in use.
- Keep the project's package manager, language, file layout, styling, and component conventions.
Add GSAP, @gsap/react, or a plugin only when the requested motion needs it. Do not replace an animation library the project already chose unless asked.
Pick GSAP or View Transitions per effect
Next.js 16.2+ activates React <ViewTransition> on every route navigation with no setup.
Use <ViewTransition> for:
- A shared element that morphs between two routes.
- A whole-page slide or crossfade keyed by
transitionTypes. - A Suspense fallback giving way to loaded content.
These need no lifecycle code and fall back to an instant swap in unsupported browsers.
Use GSAP when the effect needs:
- An outro that finishes on the live outgoing page before navigation.
- Interruption, reversal, or scrubbing mid-transition. A view transition is a fixed pair of snapshots.
- Sequenced timing across many targets, split text, or scroll-linked progress.
- A completion callback that gates navigation, focus, or unmount.
Mixing is fine: the browser morphs one image while GSAP animates the rest. Never give one element to both in the same transition. See Combining with View Transitions.
Follow the requested motion
The user's request decides effects, direction, timing, easing, and intensity. Map it onto the five phases without changing the look. For anything unspecified, keep the project's existing convention or pick a quiet default.
Read only what you need
- Page intros and outros, transition-aware links, back and forward, focus, route swaps: App Router navigation.
- The five phases, GSAP setup, React lifecycle, show and hide, layout stability, scroll, text, plugins: Lifecycle implementation.
- Before calling work done: Verification.
The official GSAP skills (gsap-core, gsap-react, gsap-timeline, gsap-scrolltrigger, gsap-plugins, gsap-utils, gsap-performance, gsap-frameworks) cover the GSAP API. This skill covers how GSAP fits React and Next.js.
Pieces to add, only as needed
- One client-only module that registers GSAP and plugins.
- A route transition boundary around page content.
- A transition-aware Link and a navigate helper, when the outro must finish before navigation.
- Refs or data attributes marking the elements a page animates.
- A controller per page or component that owns its five phases.
- Intro and outro timeline builders.
- A presence controller when conditional content must stay mounted through its outro.
Persistent header, nav, and footer live outside the route boundary. A component owns its own lifecycle; the route boundary owns page lifecycles.
Rules
- GSAP runs only on the client. Scope selectors. Clean up every tween, trigger, split, and listener.
- Lay out the final page with normal CSS first. One stable wrapper owns the geometry through every phase.
- Mount, then set initial values, then paint. Users never see the settled state before the intro.
- Animate to one settled state and clear temporary styles there.
- Keep outgoing pages and components mounted and visible through outro and end state. Unmount, or let the router hide, only after the end callback.
- Under
cacheComponents, a page lifecycle runs again on re-show against DOM that already holds settled values. Never assume a fresh node. - Back and forward never run an outro. Give them an intro-only path.
- When outgoing and incoming content overlap, only the stable wrapper takes up space in the layout.
- Keep native link behavior, focus, scroll, and no-JavaScript readability.
- Prepare incoming targets before revealing the swap. Never flash settled or stale content.
- Reduced motion reaches the same settled state and still fires every completion callback.
- Prefer transforms and
autoAlpha. Setwill-changeonly while animating, then clear it. - Use timelines for sequences. Decide up front what happens on rapid clicks and interrupted animations.
- Verify in a real browser when practical. Use a production build for route, config, dependency, or release changes.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

