Installation
Components read GSAP from the page rather than bundling it, so there is one thing to install, and you do it once.
Load GSAP
npm install gsapExpose it on window before any component script runs, and register the plugins the component lists under its dependencies.
import { gsap } from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
gsap.registerPlugin(ScrollTrigger);
window.gsap = gsap;
window.ScrollTrigger = ScrollTrigger;Put this in your app's entry file, or in a module that every page imports first.
Before the component scripts. One tag for GSAP, one per plugin a component needs; each resource lists its exact tags under Install.
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15/dist/gsap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15/dist/ScrollTrigger.min.js"></script>Loaded this way, gsap and the plugins are already on window, so there is nothing else to do.
Which plugins
Each resource names what it needs. Some components need no GSAP at all (the Pixel Button, Wavy Accordion and Infinite List among them) and say so. Plugins currently used across the Vault:
| Plugin | Used for |
|---|---|
ScrollTrigger | Scroll-driven components |
CustomEase | The library's own easing curve |
Draggable and InertiaPlugin | Dragging with momentum |
Register only what a component asks for. A missing plugin is the most common reason a component sits still.
Smooth scrolling
Nothing in the Vault requires a smooth-scroll library. The previews on each resource page run with Lenis driving GSAP's ticker; if you use Lenis too, connect it to ScrollTrigger so scroll-driven components stay in sync.
import Lenis from "lenis";
const lenis = new Lenis({ autoRaf: false });
lenis.on("scroll", ScrollTrigger.update);
gsap.ticker.add((time) => lenis.raf(time * 1000));
gsap.ticker.lagSmoothing(0);Checking it's there
Open the console and type window.gsap.version. If it prints a version, components will find it. If a component still does nothing, it logs one line saying what it couldn't find.