greensock avatar

Gsap Frameworks

This covers the proper lifecycle patterns for using GSAP in Vue, Svelte, and similar component frameworks. It handles the critical timing issues like creating animations after DOM mount and cleaning them up on unmount to prevent memory leaks. The skill emphasizes scoping selectors with gsap.context() so your animations don't accidentally target elements outside your component, which is a common gotcha when multiple component instances exist. It's basically the non-React counterpart to the gsap-react skill, giving you the same level of cleanup safety but with onMounted/onMount instead of useGSAP.

skills.sh installs
70.8K
GitHub stars
18.2K
last updated
Aug 21, 2026

Install

$ npx -y skills add greensock/gsap-skills --skill gsap-frameworks --agent claude-code

Installs into .claude/skills of the current project.

Files

GSAP with Vue, Svelte, and Other Frameworks

When to Use This Skill

Apply when writing or reviewing GSAP code in Vue (or Nuxt), Svelte (or SvelteKit), or other component frameworks that use a lifecycle (mounted/unmounted). For React specifically, use gsap-react (useGSAP hook, gsap.context()).

Related skills: For tweens and timelines use gsap-core and gsap-timeline; for scroll-based animation use gsap-scrolltrigger; for React use gsap-react.

Principles (All Frameworks)

  • Create tweens and ScrollTriggers after the component’s DOM is available (e.g. onMounted, onMount).
  • Kill or revert them in the unmount (or equivalent) cleanup so nothing runs on detached nodes and there are no leaks.
  • Scope selectors to the component root so .box and similar only match elements inside that component, not the rest of the page.

Vue 3 (Composition API)

See examples/vue/ for a runnable Vite + Vue 3 project demonstrating these patterns.

Use onMounted to run GSAP after the component is in the DOM. Use onUnmounted to clean up.

Sponsors

Details

Repository
github.com/greensock/gsap-skills
Categories
Frontend Development, Design & UI/UX
First seen
Apr 16, 2026

More from greensock/gsap-skills

All 8
1vercel avatarai-sdkvercel/aiAnswer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoo69.4Kskills.sh installs
2msmps avataropentuimsmps/opentui-skillOpenTUI skill for building terminal user interfaces with the Core, React, or Solid APIs. Use for any TUI task including components, layout, keyboard and keymap 64.5Kskills.sh installs
3expo avatarbuilding-native-uiexpo/skillsBuild beautiful, native-feeling Expo screens. Covers Apple HIG styling, semantic colors, native controls, SF Symbols, media, animations, visual effects, gradien58.1Kskills.sh installs
4clerk avatarclerk-custom-uiclerk/skillsCustom authentication flows and component appearance - hooks (useSignIn, useSignUp), themes, colors, fonts, CSS. Use for custom sign-in/sign-up flows, appearanc57.4Kskills.sh installs
5nextlevelbuilder avatarbrandnextlevelbuilder/ui-ux-pro-max-skillBrand voice, visual identity, messaging frameworks, asset management, brand consistency. Activate for branded content, tone of voice, marketing assets, brand co47.4Kskills.sh installs
6wshobson avatarbrand-landingpagewshobson/agentsBrand-first landing page designer — runs a brand-identity interview (colors, typography, shape language), then generates and iterates on a polished landing page39.9Kskills.sh installs