gsap-frameworks

Implement lifecycle-aware GSAP animations in Vue, Nuxt, and Svelte components.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/eryckassis/Dior-Luxury-Boutique-Saas --skill gsap-frameworks-eryckassis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gsap-frameworks
Source: https://github.com/eryckassis/Dior-Luxury-Boutique-Saas/tree/main/.agents/skills/gsap-frameworks
Command: npx skills add https://github.com/eryckassis/Dior-Luxury-Boutique-Saas --skill gsap-frameworks-eryckassis

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides best-practice patterns for integrating GSAP animations in component frameworks like Vue, Nuxt, and Svelte, ensuring animations are lifecycle-aware and isolated.

Core Features & Use Cases

  • Scoped animations using gsap.context to keep effects within a component root.
  • Lifecycle-aligned setups for Vue 3 (onMounted/onUnmounted), Vue script setup, and Svelte (onMount/onDestroy).
  • ScrollTrigger integration with proper cleanup to avoid leaks, including ctx.revert().

Quick Start

Follow the Vue 3 pattern to initialize gsap in onMounted and clean up in onUnmounted using gsap.context.

Frequently Asked Questions about gsap-frameworks

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

FAQPage Schema
How do I scope GSAP animations to a specific Vue or Svelte component?

GSAP context allows scoping animations to a specific component root element by passing a selector or element reference. This isolates animation effects within Vue or Svelte components, preventing selectors from leaking into unrelated DOM nodes.

Why do my GSAP animations break or cause memory leaks when a component unmounts?

GSAP animations cause memory leaks when component unmount lifecycle hooks do not trigger cleanup. Calling ctx.revert() inside onUnmounted or onDestroy properly resets inline styles and kills ScrollTriggers, preventing lingering animation artifacts.

How do I integrate ScrollTrigger with GSAP context in Nuxt components?

To integrate ScrollTrigger with GSAP context in Nuxt, initialize the ScrollTrigger inside the gsap.context callback during onMounted. This ensures the ScrollTrigger instance is included in the context scope and properly cleaned up when ctx.revert() is called.

Do I need to use gsap.context for Svelte onMount animations?

Using gsap.context in Svelte onMount is required for lifecycle-aware animations. It scopes selectors to the component root and provides a cleanup mechanism via ctx.revert() inside the onDestroy hook to prevent memory leaks.

What's the best way to structure GSAP setup and cleanup in Vue 3 script setup?

The best way to structure GSAP in Vue 3 script setup is to initialize gsap.context within the onMounted hook and store the context reference. Then, call the revert method on that context reference inside the onUnmounted hook to ensure complete animation cleanup.