gsap-react-router

Implements GSAP page transitions and component lifecycles in React Router v7/v8 applications.

1|Updated Aug 17, 2026
One-click install
npx skills add https://github.com/NalinDalal/skillset --skill gsap-react-router-nalindalal
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gsap-react-router
Source: https://github.com/NalinDalal/skillset/tree/main/skills/ui/gsap-react-router
Command: npx skills add https://github.com/NalinDalal/skillset --skill gsap-react-router-nalindalal

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? React Router has no leave hook, so routes unmount before exit animations can play, and server-rendered pages paint before GSAP can hide intro targets. This Skill provides the patterns to run full mount-to-unmount animation lifecycles—intros, outros, blockers, and cleanup—without breaking navigation, scroll, focus, or first-load performance. ## Core Features & Use Cases - Route transition control: Hold navigation with useBlocker or a transition-aware Link so outgoing pages play an outro before the router commits the new route. - Five-phase lifecycle: Apply the mount → initial state → intro → settled → outro → end state → unmount contract to pages, conditional components, and modal routes. - SSR-safe initialization: Hide intro targets with an inline root-attribute script, recover gracefully from failed bundles or stalled fonts, and protect LCP and indexing. - Use Case: Add a crossfade page transition to a React Router framework-mode app where the outgoing page fades out, proceed() releases the blocked navigation, and the incoming page animates in behind a cover while loaders finish. ## Quick Start Use the gsap-react-router skill to add GSAP page transitions with a blocker-based outro to this React Router app.

Frequently Asked Questions about gsap-react-router

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

FAQPage Schema
How do I animate page transitions in React Router with GSAP?▼

React Router has no leave hook, so hold navigation with useBlocker and call proceed() from the outro's end callback, or intercept Link clicks and call navigate after the outro. The incoming page then runs initial state and intro behind a cover.

Should I use viewTransition or GSAP for React Router animations?▼

Use Link or navigate with viewTransition for snapshot morphs and page crossfades in data/framework mode. Use GSAP for live-DOM outros that gate navigation, interruptible sequences, split text, or scroll-linked motion. Never run both engines on the same element.

Does GSAP work with React Router SSR and framework mode?▼

Yes, but route modules evaluate on the server, so keep GSAP calls inside useGSAP or effects and plugin registration in a .client side-effect module. Import gsap and useGSAP from their packages, since .client exports are undefined during SSR.

Why does my React Router animation not replay on param changes?▼

Navigating to the same route with new params reuses the mounted element, so mount-based intros never rerun. Add a pathname dependency with revertOnUpdate to useGSAP, or key the Outlet on location.pathname to force a remount.

How do I prevent hidden content from hurting SEO and LCP with GSAP intros?▼

Keep primary text and links in server-rendered HTML and hide intro targets only under a root attribute set by an inline script, with a no-JavaScript path. Bound initialization with a deadline and recover to readable settled content on failure.