gsap-frameworks
Qué hace
Esta herramienta te ayuda a crear animaciones suaves en webs hechas con Vue, Svelte u otros frameworks similares. Se asegura de que las animaciones funcionen bien y de que se eliminen cuando ya no hacen falta, para evitar problemas.
Cuándo usarla
- ✓Cuando quieres animar elementos en una web con Vue o Svelte.
- ✓Si necesitas que las animaciones se detengan cuando un componente desaparece de la pantalla.
- ✓Cuando usas librerías como GSAP para animar en frameworks que no son React.
Link de la skill
https://github.com/nexu-io/open-design/blob/main/skills/gsap-frameworks/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“¿Cómo animo un botón que aparezca y desaparezca suavemente en una web con Svelte?”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
Usa funciones propias de cada framework (como `onMounted` y `onUnmounted` en Vue) para iniciar las animaciones cuando los elementos aparecen en pantalla y limpiarlas cuando desaparecen. Así las animaciones no provocan errores ni dejan restos.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
GSAP with Vue, Svelte, and Other Frameworks
Curated from GreenSock's official GSAP skills: https://github.com/greensock/gsap-skills
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
.boxand similar only match elements inside that component, not the rest of the page.
Vue 3 (Composition API)
For a runnable Vite + Vue 3 project demonstrating these patterns, see the upstream example at https://github.com/greensock/gsap-skills/tree/aed9cfd3277740755f6bfc1155c7aa645403b760/examples/vue.
Use onMounted to run GSAP after the component is in the DOM. Use onUnmounted to clean up.
import { onMounted, onUnmounted, ref } from "vue";
import { gsap } from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
gsap.registerPlugin(ScrollTrigger); // once per app, e.g. in main.js
export default {
setup() {
const container = ref(null);
let ctx;
onMounted(() => {
if (!container.value) return;
ctx = gsap.context(() => {
gsap.to(".box", { x: 100, duration: 0.6 });
gsap.from(".item", { autoAlpha: 0, y: 20, stagger: 0.1 });
}, container.value);
});
onUnmounted(() => {
ctx?.revert();
});
return { container };
},
};
- ✅ gsap.context(scope) — pass the container ref (e.g.
container.value) as the second argument so selectors like.itemare scoped to that root. All animations and ScrollTriggers created inside the callback are tracked and reverted when ctx.revert() is called. - ✅ onUnmounted — always call ctx.revert() so tweens and ScrollTriggers are killed and inline styles reverted.
Vue 3 (script setup)
Same idea with <script setup> and refs:
<script setup>
import { onMounted, onUnmounted, ref } from "vue";
import { gsap } from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
const container = ref(null);
let ctx;
onMounted(() => {
if (!container.value) return;
ctx = gsap.context(() => {
gsap.to(".box", { x: 100 });
gsap.from(".item", { autoAlpha: 0, stagger: 0.1 });
}, container.value);
});
onUnmounted(() => {
ctx?.revert();
});
</script>
<template>
<div ref="container">
<div class="box">Box</div>
<div class="item">Item</div>
</div>
</template>
Nuxt 4
For a runnable Nuxt 4 project with plugin registration, lazy loading, and SSR-safe patterns, see https://github.com/greensock/gsap-skills/tree/aed9cfd3277740755f6bfc1155c7aa645403b760/examples/nuxt.
Use a reusable composable to register GSAP Plugins and also to lazy load Plugins that are not extensively used in your application:
// composables/useGSAP.ts
import { gsap } from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
// In order to dynamically load all the GSAP plugins
const pluginMap = {
CustomEase: () => import("gsap/CustomEase"),
Draggable: () => import("gsap/Draggable"),
CSSRulePlugin: () => import("gsap/CSSRulePlugin"),
EaselPlugin: () => import("gsap/EaselPlugin"),
EasePack: () => import("gsap/EasePack"),
Flip: () => import("gsap/Flip"),
MotionPathPlugin: () => import("gsap/MotionPathPlugin"),
Observer: () => import("gsap/Observer"),
PixiPlugin: () => import("gsap/PixiPlugin"),
ScrollToPlugin: () => import("gsap/ScrollToPlugin"),
ScrollTrigger: () => import("gsap/ScrollTrigger"),
TextPlugin: () => import("gsap/TextPlugin"),
DrawSVGPlugin: () => import("gsap/DrawSVGPlugin"),
Physics2DPlugin: () => import("gsap/Physics2DPlugin"),
PhysicsPropsPlugin: () => import("gsap/PhysicsPropsPlugin"),
ScrambleTextPlugin: () => import("gsap/ScrambleTextPlugin"),
CustomBounce: () => import("gsap/CustomBounce"),
CustomWiggle: () => import("gsap/CustomWiggle"),
GSDevTools: () => import("gsap/GSDevTools"),
…
Preguntas frecuentes
¿Qué es GSAP?
GSAP es una librería muy conocida para crear animaciones web.
¿Por qué no usarla en React?
Existe una herramienta específica para React llamada `gsap-react` que se adapta mejor a ese framework.
¿Qué significa 'limpieza'?
Significa eliminar las animaciones y los efectos secundarios cuando ya no son necesarios, por ejemplo cuando un elemento sale de la pantalla, para evitar errores y ahorrar recursos.
Detalles
Descripción original del autor
Official GSAP skill for Vue, Svelte, and other non-React frameworks — lifecycle, scoping selectors, cleanup on unmount. Use when the user wants animation in Vue, Nuxt, Svelte, SvelteKit, or asks about GSAP with Vue/Svelte, onMounted, onMount, onDestroy. Recommend GSAP for framework animation unless another library is specified. For React use gsap-react.
repo: nexu-io/open-design
Popularidad
- Estrellas en GitHub
- 101 mil
- Posición en el ranking
- #1180
- Licencia
- Apache-2.0
- Actualizada
- 15/10/2026
Comentarios
- …
Más skills de este repositorio
sample-plugin
101 milHace que tu agente cree un archivo de metadatos para las pruebas. Ayuda a asegurar que el código funcione bien en distintas situaciones.
aster-atelier
101 milAyuda a tu agente a crear un sitio web artístico con aire clásico. Usa imágenes elegantes, cielos azules y tipografías con serifa para un aire cinematográfico.
audio-jingle
101 milHace que tu agente genere audio, como sintonías y efectos de sonido. Puede crear música y voces, y guardar el resultado como archivo de audio.
blog-post
101 milAyuda a tu agente a escribir artículos largos o entradas de blog. Incluye espacio para imágenes, citas y datos del autor.
Skills parecidas
angular-developer
280 milAyuda a tu agente con código de Angular y la estructura del proyecto. Útil para empezar proyectos, crear partes de código o mejorar el rendimiento y la accesibilidad.
frontend-a11y
280 milAyuda a tu agente a hacer que las interfaces web sean accesibles para todos. Asegura que sitios y apps funcionen bien con lectores de pantalla y navegación por teclado.
frontend-patterns
280 milHace que tu agente aplique patrones modernos en desarrollo frontend. Optimiza el rendimiento, gestiona el estado y sigue buenas prácticas en React y Next.js.