gsap-frameworks

Apply GSAP animations in Vue and Svelte with lifecycle cleanup.

2|1|Updated Mar 18, 2021
One-click install
npx skills add https://github.com/nnecec/nnecec.studio --skill gsap-frameworks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gsap-frameworks
Source: https://github.com/nnecec/nnecec.studio/tree/main/.agents/skills/gsap-frameworks
Command: npx skills add https://github.com/nnecec/nnecec.studio --skill gsap-frameworks

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers apply GSAP animations across component-based frameworks while ensuring correct lifecycle handling and cleanup, preventing leaks and DOM-insertion issues.

Core Features & Use Cases

  • Lifecycle-aware animation setup and cleanup using gsap.context to scope animations to a component root.
  • Framework-specific guidance for Vue (onMounted/onUnmounted) and Svelte (onMount) plus notes on Nuxt and SvelteKit.
  • Clear recommendation: for React use gsap-react; for other frameworks, align with gsap-core/gsap-timeline as needed.

Quick Start

Initialize GSAP animations inside Vue or Svelte lifecycle hooks and revert on unmount to ensure clean teardown.

Frequently Asked Questions about gsap-frameworks

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

FAQPage Schema
How do I clean up GSAP animations when a Vue component unmounts?

To clean up GSAP animations on Vue component unmount, initialize them within lifecycle hooks like onMounted and use gsap.context to scope selectors to the component root, then call revert on unmount to prevent memory leaks.

What is the best way to scope GSAP animations to a specific Svelte component?

The best way to scope GSAP animations in Svelte is by using gsap.context inside the onMount lifecycle hook, which restricts selector text to the component root and ensures proper cleanup when the component is destroyed.

Does this GSAP lifecycle guidance apply to Nuxt and SvelteKit environments?

Yes, this GSAP lifecycle guidance applies to Nuxt and SvelteKit environments, providing framework-specific patterns for scoping animations to component roots and ensuring proper teardown during server-side rendering and hydration.

Why do my GSAP animations target the wrong DOM elements in component-based frameworks?

GSAP animations target wrong DOM elements in component frameworks because global selectors match across the entire document, so you must use gsap.context to scope selector text specifically to the current component's root element.

Can I use this approach for React GSAP animations?

For React GSAP animations, you should use the dedicated gsap-react Skill instead of this approach, which is specifically designed for Vue, Svelte, Nuxt, and SvelteKit component lifecycle management and cleanup.

Do I need gsap core installed to use these component animation patterns?

Yes, you need gsap core installed to use these component animation patterns, and possibly additional GSAP plugins depending on the specific animation requirements, to ensure proper lifecycle management and scoping.