npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

slidev-addon-gsap

v0.0.4

Published

Integrate GSAP animations into SliDev

Readme

License: GPL v3

GSAP Addon for Slidev

A GSAP + Two.js addon for Slidev. It gives you click-driven animation timelines, reactive element anchors, arrows/paths/circles drawn over your slides, and magic-move morphs both within and across slides.

Docs: maxkurze1.github.io/slidev-addon-gsap/docs

Live demo deck: maxkurze1.github.io/slidev-addon-gsap/demo

NPM package: npmjs.com/package/slidev-addon-gsap

Install

$ pnpm install git+https://github.com/maxkurze1/slidev-addon-gsap.git

Enable it in your deck headmatter (the first --- block). Slidev automatically prepends the slidev-addon- prefix (docs):

---
addons:
  - gsap
---

Then import the composables inside a slide's <script setup>:

import { useTl, usePos, useTwo, useSlide } from 'slidev-addon-gsap'

See example.md for a full, runnable showcase of every feature.

Features at a glance

useTl — click-driven timelines

A paused GSAP timeline split into steps; each click plays to the next step. The click count is inferred from the number of step() calls — no clicks: frontmatter needed.

<script setup lang="ts">
import { onMounted } from 'vue'
import { useTl } from 'slidev-addon-gsap'

const tl = useTl()
onMounted(() => {
  tl.step()
    .from('.title', { opacity: 0, y: 20 })
    .step()
    .to('.title', { x: 100 })
    .step()
})
</script>

All of GSAP is available (from/to/fromTo, stagger, easing, labels), and CSS selectors are scoped to the current slide. tl.morph('.a', '.b') adds a within-slide magic-move (A morphs into B's box) as a timeline step.

Chainable preset effects cover the common cases with good defaults:

tl.step().popIn('.a')
  .step().slideIn('.b', { from: 'left' })
  .step().pulse('.b')

Entrances fadeIn popIn scaleIn slideIn flyIn blurIn dropIn, exits fadeOut popOut scaleOut slideOut flyOut, emphasis pulse shake wiggle flash bounce — each takes optional GSAP vars to override.

usePos — reactive element anchors

pos('selector@anchor') is a live point on a DOM element, re-measured every frame so it tracks layout, GSAP moves and resizes.

const pos = usePos()
pos('.card@tr')   // top-right (axis-aligned)
pos('.card@ne')   // north-east corner — rotates *with* the element
pos('.item')      // fan-out: one point per matching element

Axis-aligned anchors: c t b l r tl tr bl br. Rotation-aware: n s e w ne nw se sw.

useTwo — arrows, paths & circles

Two.js drawing layers (two.back behind the slide, two.front above it). Pass anchor strings directly; endpoints stay reactive.

const two = useTwo()
onMounted(() => {
  two.back.mkArrow('.a@r', '.b@l', { stroke: '#0ea5e9', linewidth: 3, text: 'flows to' })
  two.back.mkPath({ head: 'triangle', radius: 14 }).M('.a@r').h(28).VH('.b@l')
  two.front.mkCircle('.c@center', 40, { fill: '#34d399' })
})

Animate shapes on with tl.from(shape, { end: 0 }). Deck-wide defaults can be set via a twojs: headmatter block.

Cross-slide morph (magic-move between slides)

Give elements on adjacent slides the same data-morph="key" and the one on the next slide flies/resizes from where the first was — during the slide transition, for any transition. No setup needed; it's wired globally.

---
transition: slide-left
morph: { duration: 0.4 }   # the lower-indexed slide of the pair owns the effect
---
<div data-morph="hero" class="...">🚀</div>

Composables

| Composable | Purpose | |-------------|---------| | useTl | Paused, click-driven GSAP timeline (step, from/to/fromTo, morph) | | usePos | Reactive selector@anchor points on DOM elements | | useTwo | Two.js front/back layers with mkArrow / mkPath / mkCircle | | useSlide | Ref to the current slide's root element |

AI assistant skill

This package ships an Agent Skill so AI coding assistants (e.g. Claude Code) know the full API and conventions when helping you author decks that use this addon.

Load it into a repo that uses this library

After installing the addon, copy (or symlink) the skill into your presentation repo's .claude/skills/ directory, which Claude Code auto-discovers:

# copy — a static snapshot
mkdir -p .claude/skills
cp -r node_modules/slidev-addon-gsap/skills/slidev-gsap .claude/skills/

# …or symlink — stays in sync when you update the addon
ln -s ../../node_modules/slidev-addon-gsap/skills/slidev-gsap .claude/skills/slidev-gsap

For all your projects at once, copy it into the global skills dir instead:

cp -r node_modules/slidev-addon-gsap/skills/slidev-gsap ~/.claude/skills/

The assistant then picks up the skill whenever you ask it to create or edit slides for a deck using this addon. Other agent tools that support a skills / rules directory can point at the same SKILL.md.

Contributing