gsap-frameworks

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

1|Updated Aug 6, 2026
One-click install
npx skills add https://github.com/luce12/agent-dev-workflow --skill gsap-frameworks-luce12
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gsap-frameworks
Source: https://github.com/luce12/agent-dev-workflow/tree/main/toolkits/gsap-frameworks
Command: npx skills add https://github.com/luce12/agent-dev-workflow --skill gsap-frameworks-luce12

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gsap.

What problem does it solve? GSAP animations in component frameworks often leak memory, run on detached DOM nodes, or accidentally target elements outside the component because tweens are created before mount or never cleaned up on unmount. ## Core Features & Use Cases - Lifecycle-Safe Patterns: Create tweens and ScrollTriggers inside onMounted/onMount and revert them with ctx.revert() on unmount for Vue 3, Nuxt 4, and Svelte. - Scoped Selectors: Use gsap.context(callback, scope) so selectors like .box only match elements inside the component root. - 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: When building a Vue 3 landing page with scroll-triggered reveals, wrap all GSAP code in a gsap.context scoped to the container ref and call ctx.revert() in onUnmounted to prevent leaks across route navigation. ## Quick Start Ask the agent to add a GSAP scroll-triggered fade-in animation to a Vue 3 component using gsap.context with proper onUnmounted cleanup.

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 GSAP animations inside onMounted using gsap.context(callback, container.value) so selectors are scoped to the component root. 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 onMount?▼

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

Does GSAP work with Nuxt and SSR?▼

Yes, register plugins once in a composable like useGSAP and only create animations in onMounted, which runs client-side after the DOM exists. The composable can also lazy-load plugins such as SplitText or MorphSVG to keep the initial bundle small.

Should I use gsap-frameworks or gsap-react for React?▼

Use the gsap-react skill for React, which covers the useGSAP hook and contextSafe patterns. This skill targets Vue, Nuxt, Svelte, and other lifecycle-based frameworks where you manage onMounted and unmount cleanup manually.

Why do GSAP animations affect elements outside my component?▼

Selector strings like .box match globally when no scope is provided. Pass the container element as the second argument to gsap.context so all selectors inside the callback are limited to that component's subtree.

Why do ScrollTriggers break after navigating between pages?▼

ScrollTriggers created without cleanup keep running on detached nodes after unmount. Create them inside gsap.context and call ctx.revert() on unmount, then call ScrollTrigger.refresh() after layout changes such as async data loading.