Composable Vue 3 para usar GSAP con contexto (inspirado en @gsap/react)
npm install gsap-vue!NPM Downloads




A Vue 3 Composable for using GSAP with context, inspired by @gsap/react.
- ✅ Fully compatible with Vue 3 Composition API
- ✅ Automatic GSAP context handling and cleanup
- ✅ Optional scope for selector text (no need for multiple refs)
- ✅ Dependency tracking (reactivity-aware)
- ✅ contextSafe for event listeners and delayed callbacks
- ✅ Headless mode for SSR or non-browser environments
``bash`
npm install gsap gsap-vueor
yarn add gsap gsap-vue
`vue
Animated
`
* useGSAP(callback, config?) — Core composable for GSAP animations.useGSAP.register(core: typeof gsap)
* — Replace GSAP core if needed.useGSAP.headless = true
* — Enable headless mode for SSR or tests.
- scope → limits selector text to a container ref
- dependencies → reactive dependencies to re-run animations
- revertOnUpdate → revert context on dependency change
`vue
Manual Animation
`
`vue
Easy Animation
`
`vue
`
`vue
`
`vue
``
Check the demo folder for examples of usage.
Contributions are welcome! Please fork the repository and submit a pull request.
MIT License © c5vagas