gsap-frameworks

Configure GSAP animations in Vue and Svelte with lifecycle-safe mounting and cleanup.

Updated Apr 2, 2026
One-click install
npx skills add https://github.com/gyalamanch001a/pur-new --skill gsap-frameworks-gyalamanch001a
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gsap-frameworks
Source: https://github.com/gyalamanch001a/pur-new/tree/main/.agents/skills/gsap-frameworks
Command: npx skills add https://github.com/gyalamanch001a/pur-new --skill gsap-frameworks-gyalamanch001a

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you build GSAP animations that work correctly inside component-based frameworks by waiting for the DOM to mount, scoping selectors to the right subtree, and cleaning everything up on unmount.

Core Features & Use Cases

  • Lifecycle-safe animation setup: Create tweens and ScrollTriggers only after the component is mounted so elements exist before animation starts.
  • Scoped selector handling: Use a component root or ref to prevent animations from affecting other parts of the page.
  • Cleanup on destroy: Revert GSAP contexts during unmount so animations, triggers, and inline styles do not leak.
  • Use case: Build a Vue or Svelte component with entrance effects, scroll-based reveals, or repeated UI instances without cross-component conflicts.

Quick Start

Use the gsap-frameworks skill to rewrite my Vue or Svelte animation so it initializes after mount, scopes selectors to the component root, and cleans up properly 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 or target wrong elements in Vue and Svelte components?

GSAP animations break in Vue and Svelte when selectors leak outside the component subtree or tweens initialize before the DOM mounts. Scoping selectors with gsap.context and creating tweens only after mount prevents these lifecycle bugs and detached-node updates.

How do I set up GSAP ScrollTrigger safely inside a SvelteKit or Nuxt component?

To set up GSAP ScrollTrigger safely in SvelteKit or Nuxt, initialize triggers only after the component is mounted so target elements exist, scope selectors to the component root using gsap.context, and revert the context during unmount to clean up triggers and prevent leaks.

Does GSAP work with Vue 3 component lifecycles without causing memory leaks?

GSAP works with Vue 3 lifecolds without memory leaks by creating tweens and ScrollTriggers inside gsap.context after the mounted hook, then calling context.revert() during the unmounted hook to clear inline styles, triggers, and detached node references.

What is the best way to clean up GSAP animations on component unmount in Svelte?

The best way to clean up GSAP animations on Svelte component unmount is wrapping tweens in a gsap.context and calling its revert method during the destroy lifecycle phase, removing triggers and preventing style leakage to other UI instances.

Can I use gsap.context to scope animations to a specific Vue ref?

You can use gsap.context to scope GSAP animations to a specific Vue ref by passing the component root or ref element as the context scope parameter, ensuring selectors only match nodes within that subtree and ignore the rest of the page.