gsap-frameworks

Implements GSAP animations in Vue, Nuxt, and Svelte with lifecycle-safe scoping and cleanup.

Updated Aug 26, 2026
One-click install
npx skills add https://github.com/aungpwint/presentation --skill gsap-frameworks-aungpwint
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gsap-frameworks
Source: https://github.com/aungpwint/presentation/tree/main/.agents/skills/gsap-frameworks
Command: npx skills add https://github.com/aungpwint/presentation --skill gsap-frameworks-aungpwint

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gsap.

What problem does it solve? GSAP animations in component frameworks like Vue, Nuxt, and Svelte often leak memory, target wrong elements, or run before the DOM exists because developers skip lifecycle-aware setup and cleanup. This Skill provides the correct patterns for creating, scoping, and reverting GSAP animations and ScrollTriggers inside component lifecycles. ## Core Features & Use Cases - Lifecycle-Safe Animation Setup: Create tweens and ScrollTriggers inside onMounted/onMount and revert them with ctx.revert() on unmount to prevent leaks and detached-node animations. - Scoped Selectors with gsap.context(): Pass a container ref as the scope so selectors like .box only match elements inside the component, never the rest of the page. - Nuxt 4 Composable with Lazy Plugin Loading: A typed useGSAP composable that registers plugins once and lazy-loads rarely used plugins like SplitText or MorphSVG to reduce bundle size. - Use Case: You are building a Nuxt landing page with scroll-triggered reveals. Use this Skill to register ScrollTrigger once, scope animations per component, and clean them up on route change without memory leaks. ## Quick Start Add GSAP scroll animations to my Vue 3 component with proper cleanup on unmount.

Frequently Asked Questions about gsap-frameworks

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

FAQPage Schema
How do I use GSAP in a Vue 3 component?▼

Create animations inside onMounted using gsap.context() with the container ref as scope, then call ctx.revert() in onUnmounted. This ensures the DOM exists before animating and all tweens and ScrollTriggers are cleaned up when the component is destroyed.

How to add GSAP ScrollTrigger in Nuxt with SSR?▼

Register ScrollTrigger once in a useGSAP composable and create triggers inside onMounted so they only run client-side. Use gsap.context() with a container scope and call ctx.revert() on unmount; rarely used plugins can be lazy-loaded via dynamic imports.

Does GSAP work with Svelte and SvelteKit?▼

Yes, GSAP works in Svelte by creating animations inside onMount and returning a cleanup function that calls ctx.revert(). Use bind:this to get the container element and pass it as the scope to gsap.context() so selectors stay inside the component.

Why do my GSAP animations affect other components on the page?▼

Global selector strings like .box match elements across the entire page when no scope is provided. Pass the component's container element as the second argument to gsap.context() so selectors only search within that subtree.

Should I use this or gsap-react for a React project?▼

For React, use the gsap-react skill instead, which covers the useGSAP hook and React-specific context patterns. This skill targets Vue, Nuxt, Svelte, and other non-React frameworks with mounted/unmounted lifecycles.