gsap-frameworks

Implements GSAP animations in Vue, Nuxt, and Svelte with lifecycle-safe cleanup and scoped selectors.

Updated Aug 9, 2026
One-click install
npx skills add https://github.com/HoussamMrabet/ultimate-TicTacToe --skill gsap-frameworks-houssammrabet
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gsap-frameworks
Source: https://github.com/HoussamMrabet/ultimate-TicTacToe/tree/main/skills/gsap/gsap-frameworks
Command: npx skills add https://github.com/HoussamMrabet/ultimate-TicTacToe --skill gsap-frameworks-houssammrabet

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gsap.

What problem does it solve? GSAP animations in component frameworks like Vue, Nuxt, and Svelte often leak memory, target elements outside the component, or run before the DOM exists. This Skill provides the correct lifecycle patterns—creating animations after mount, scoping selectors to the component root, and reverting everything on unmount—so animations behave correctly in real applications. ## Core Features & Use Cases - Lifecycle-Safe Patterns: Create tweens and ScrollTriggers inside onMounted/onMount and call ctx.revert() in onUnmounted or the onMount cleanup return. - Scoped Selectors: Use gsap.context(callback, scope) with a container ref so selectors like .box only match elements inside the component. - Nuxt 4 Composable: A typed useGSAP composable that registers plugins once and lazy-loads rarely used plugins like SplitText or MorphSVG to reduce bundle size. - Use Case: You are building a Vue 3 landing page where each section animates in on scroll. Use this Skill to wrap each section's GSAP code in a scoped context and guarantee ScrollTriggers are killed when the user navigates away. ## Quick Start Show me how to animate a list of items with GSAP in my Vue 3 component, including proper cleanup when the component unmounts.

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 in a Vue 3 component?

Create animations inside onMounted using gsap.context with your container ref as the scope, then call ctx.revert() in onUnmounted. This ensures the DOM exists before animating and all tweens and ScrollTriggers are cleaned up on unmount.

How do I register and lazy-load GSAP plugins in Nuxt?

Create a useGSAP composable that calls gsap.registerPlugin once for widely used plugins like ScrollTrigger. For rarely used plugins like SplitText or MorphSVG, use dynamic imports in a lazyLoadPlugin function to reduce initial bundle size.

Should I use gsap-frameworks or gsap-react for React projects?

Use gsap-react for React projects, which covers the useGSAP hook and contextSafe patterns. This Skill targets Vue, Nuxt, Svelte, and other frameworks with mounted/unmounted lifecycles instead.

Why do my GSAP animations affect elements outside my component?

Global selector strings like .box match elements across the entire page. Pass your container element as the second argument to gsap.context so selectors only search within that component's subtree.

How do I clean up ScrollTrigger when a Svelte component is destroyed?

Return a cleanup function from onMount that calls ctx.revert() on the gsap.context you created. This kills all ScrollTriggers and tweens in that context and reverts inline styles when the component is destroyed.

Why does my GSAP animation not run in Vue setup?

Animations created in setup or top-level script run before the component's DOM exists, so target elements are missing. Always create tweens inside onMounted after confirming the container ref is populated.