gsap-frameworks

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

Updated Jun 17, 2026
One-click install
npx skills add https://github.com/KKChen666/TongXiao --skill gsap-frameworks-kkchen666
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gsap-frameworks
Source: https://github.com/KKChen666/TongXiao/tree/main/.opencode/skills/gsap-frameworks
Command: npx skills add https://github.com/KKChen666/TongXiao --skill gsap-frameworks-kkchen666

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 in these frameworks. ## Core Features & Use Cases - Lifecycle-Safe Animation Setup: Create tweens and ScrollTriggers inside onMounted (Vue) or onMount (Svelte) so the DOM is ready, and revert them on unmount with ctx.revert(). - Scoped Selectors: Use gsap.context(callback, scope) with a container ref so selectors like .box only match elements inside the current component. - Nuxt Plugin Management: 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 Vue 3 dashboard where cards animate in on scroll. This Skill shows you how to scope the ScrollTrigger to the component, refresh it after data loads, and clean it up when the user navigates away. ## Quick Start Show me how to add a GSAP scroll-triggered fade-in animation 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(callback, containerRef) so selectors are scoped to the component. Store the context and call ctx.revert() in onUnmounted to kill tweens and ScrollTriggers when the component is destroyed.

How to add GSAP animations in Svelte with cleanup?

Use onMount with a bind:this reference to the container element, then create animations inside gsap.context scoped to that element. Return a cleanup function from onMount that calls ctx.revert() so animations are reverted when the component is destroyed.

Does GSAP work with Nuxt and SSR?

Yes, GSAP works with Nuxt when animations are created client-side in onMounted. A useGSAP composable can register plugins once and lazy-load rarely used plugins like SplitText or MorphSVG to keep the initial bundle small.

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

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

When should I use gsap-react instead of this approach?

Use the gsap-react skill when working in React, since it covers the useGSAP hook and contextSafe patterns specific to React's rendering model. This skill targets Vue, Nuxt, Svelte, and similar lifecycle-based frameworks.