gsap-frameworks

Set up and clean up GSAP animations within Vue, Nuxt, and Svelte lifecycles.

Updated Jun 4, 2026
One-click install
npx skills add https://github.com/Carlosfwd86/Conectando-Talento-UCR --skill gsap-frameworks-carlosfwd86
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gsap-frameworks
Source: https://github.com/Carlosfwd86/Conectando-Talento-UCR/tree/main/Skill%20GSAP/gsap-skills/skills/gsap-frameworks
Command: npx skills add https://github.com/Carlosfwd86/Conectando-Talento-UCR --skill gsap-frameworks-carlosfwd86

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you use GSAP in component-based frameworks without lifecycle bugs, leaked animations, or selectors that affect the wrong elements.

Core Features & Use Cases

  • Lifecycle-safe animation setup: Create tweens and ScrollTriggers only after the DOM is mounted in Vue, Nuxt, Svelte, or similar frameworks.
  • Reliable cleanup on unmount: Revert GSAP contexts and kill animations when components are destroyed so detached nodes do not keep running.
  • Scoped selectors and plugin guidance: Keep selectors limited to a component root, register plugins once, and use lazy loading for less common GSAP plugins.
  • Use Case: Build a Vue page section or Svelte component with entrance animations and scroll effects that work correctly across mounts, route changes, and SSR-aware apps.

Quick Start

Ask for GSAP code that sets up a scoped animation in Vue or Svelte after mount and reverts it on unmount.

Frequently Asked Questions about gsap-frameworks

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

FAQPage Schema
Why do my GSAP animations break after route changes in Vue or Svelte?

GSAP animations break after route changes because tweens and ScrollTriggers are not properly cleaned up on component unmount. Reverting GSAP contexts and killing active animations when components are destroyed prevents detached DOM nodes from continuing to run.

How do I set up GSAP ScrollTrigger safely in a Svelte component?

To set up GSAP ScrollTrigger safely in Svelte, initialize tweens and ScrollTriggers only after the DOM is mounted. Use lifecycle-safe initialization to ensure elements exist before creating animations, and scope selectors to the component root to avoid targeting wrong elements.

What's the best way to prevent GSAP selector leaks in Nuxt applications?

The best way to prevent GSAP selector leaks in Nuxt is to use context-based scoping that limits selectors to a specific component root. This ensures animations only affect elements within the intended component boundary rather than matching similar elements across the entire page.

Does GSAP work with SSR in Nuxt without causing hydration errors?

GSAP works with Nuxt SSR when you use lazy loading for less common plugins and defer animation initialization to mounting time. Registering plugins once and avoiding DOM access during server-side rendering prevents hydration mismatches and keeps animations SSR-safe.

How do I clean up GSAP timelines when a Vue component is destroyed?

Clean up GSAP timelines when a Vue component is destroyed by reverting GSAP contexts and killing animations during the unmount lifecycle. This ensures tweens, timelines, and ScrollTriggers associated with detached nodes stop running and free up resources.

Can I use GSAP context scoping to limit animations to a specific component?

GSAP context scoping limits animations to a specific component by restricting selector queries to the component root element. This approach prevents selectors from accidentally matching elements outside the component, ensuring tweens and timelines only animate intended nodes.