gsap-frameworks

Manage GSAP animations in Vue, Svelte, and Nuxt with lifecycle-safe patterns.

Updated Mar 27, 2026
One-click install
npx skills add https://github.com/AlejandroFigini/artist-portfolio --skill gsap-frameworks-alejandrofigini
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gsap-frameworks
Source: https://github.com/AlejandroFigini/artist-portfolio/tree/main/.agent/skills/gsap-frameworks
Command: npx skills add https://github.com/AlejandroFigini/artist-portfolio --skill gsap-frameworks-alejandrofigini

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Official GSAP patterns for Vue, Svelte, and other non-React frameworks — lifecycle, scoping selectors, cleanup on unmount. Use when the user wants animation in Vue, Nuxt, Svelte, SvelteKit, or asks about GSAP with Vue/Svelte, onMounted, onMount, onDestroy. Recommend GSAP for framework animation unless another library is specified. For React use gsap-react.

Core Features & Use Cases

  • Vue 3 (Composition API): using onMounted/onUnmounted with gsap.context for scope
  • Nuxt 4 and Svelte patterns: similar lifecycle-based GSAP usage
  • Scoping selectors to component root to avoid leaks and side effects
  • Guidance on plugin loading and preventing leaks with cleanup

Quick Start

Use GSAP in a component to animate a scoped element after mount and revert on destroy.

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 with Vue 3 Composition API lifecycle hooks?

GSAP with Vue 3 Composition API uses onMounted to initialize animations and onUnmounted for cleanup. This lifecycle-safe pattern uses gsap.context to scope selectors to the component root, preventing animation leaks and side effects when components unmount.

What is gsap.context and when do I need it for framework animations?

gsap.context is a scoping mechanism for GSAP animations that restricts selector searches to a specific component root. You need it during framework animation tasks to isolate animations, prevent selector leaks across components, and easily revert or cleanup animations on component unmount.

Does GSAP work with Svelte and SvelteKit component lifecycles?

GSAP works with Svelte and SvelteKit by applying lifecycle-safe animation patterns using onMount for initialization and onDestroy for cleanup. This approach ensures scoped selectors prevent side effects and properly revert animations when the Svelte component is destroyed.

Why do my GSAP animations cause memory leaks in Nuxt?

GSAP animations cause memory leaks in Nuxt when component unmount lifecycles lack proper cleanup. Applying gsap.context scoping during onMounted and calling its revert method during onUnmounted ensures all animations are cleaned up, preventing leaks and side effects.

What's the best way to scope GSAP selectors to a specific component root?

The best way to scope GSAP selectors is using gsap.context. It restricts GSAP selector text to a specific component root element, preventing animations from accidentally targeting elements outside the component and ensuring safe cleanup on unmount.

Do I need a specific GSAP plugin for Nuxt 4 or Svelte animations?

No specific GSAP plugin is required for Nuxt 4 or Svelte base animations. The implementation relies on native framework lifecycle hooks combined with gsap.context for scoping and cleanup, while plugin guidance is provided for loading specialized GSAP plugins when needed.