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

@tuel/gsap

v0.2.0

Published

GSAP integration components for React. High-performance animations using GreenSock Animation Platform with React-friendly components.

Readme

@tuel/gsap

GSAP integration utilities and React-friendly wrappers for the GreenSock Animation Platform.

npm version TypeScript License: MIT

Features

  • 🚀 GSAP Power - Harness the full power of GSAP in React
  • 🎬 React Hooks - Easy-to-use hooks for GSAP animations
  • 📦 Type-safe - Full TypeScript support
  • 🔧 Auto Cleanup - Automatic cleanup on unmount
  • 🎯 Plugin Support - Works with GSAP plugins (ScrollTrigger, etc.)
  • 🌳 Tree-shakeable - Import only what you need

Installation

pnpm add @tuel/gsap

# Peer dependency
pnpm add gsap

Quick Start

import { useGSAP } from '@tuel/gsap';
import { useRef } from 'react';

function AnimatedComponent() {
  const boxRef = useRef(null);

  useGSAP(() => {
    gsap.to(boxRef.current, {
      x: 100,
      duration: 1,
      ease: 'power2.out',
    });
  }, []);

  return <div ref={boxRef}>Animated Box</div>;
}

API Reference

useGSAP

Hook for GSAP animations with automatic cleanup.

import { useGSAP } from '@tuel/gsap';
import gsap from 'gsap';

function Component() {
  const ref = useRef(null);

  useGSAP(() => {
    // Animation code here
    gsap.to(ref.current, { x: 100 });
  }, [dependencies]);

  return <div ref={ref}>Content</div>;
}

useGSAPTimeline

Create and manage GSAP timelines.

import { useGSAPTimeline } from '@tuel/gsap';

function TimelineComponent() {
  const { timeline, play, pause, reverse } = useGSAPTimeline();

  useEffect(() => {
    timeline
      .to('.box1', { x: 100, duration: 1 })
      .to('.box2', { y: 100, duration: 1 })
      .to('.box3', { rotation: 360, duration: 1 });
  }, []);

  return (
    <div>
      <button onClick={play}>Play</button>
      <button onClick={pause}>Pause</button>
      <button onClick={reverse}>Reverse</button>
    </div>
  );
}

Usage Examples

Simple Animation

import { useGSAP } from '@tuel/gsap';
import gsap from 'gsap';

function FadeIn() {
  const elementRef = useRef(null);

  useGSAP(() => {
    gsap.from(elementRef.current, {
      opacity: 0,
      y: 50,
      duration: 1,
      ease: 'power3.out',
    });
  }, []);

  return <div ref={elementRef}>Fade in content</div>;
}

Stagger Animation

function StaggeredList({ items }) {
  const listRef = useRef(null);

  useGSAP(() => {
    gsap.from(listRef.current.children, {
      opacity: 0,
      y: 20,
      stagger: 0.1,
      duration: 0.6,
      ease: 'power2.out',
    });
  }, [items]);

  return (
    <ul ref={listRef}>
      {items.map((item) => (
        <li key={item.id}>{item.text}</li>
      ))}
    </ul>
  );
}

ScrollTrigger Integration

import { useGSAP } from '@tuel/gsap';
import gsap from 'gsap';
import { ScrollTrigger } from 'gsap/ScrollTrigger';

gsap.registerPlugin(ScrollTrigger);

function ScrollAnimation() {
  const sectionRef = useRef(null);

  useGSAP(() => {
    gsap.from(sectionRef.current, {
      opacity: 0,
      y: 100,
      scrollTrigger: {
        trigger: sectionRef.current,
        start: 'top center',
        end: 'bottom center',
        scrub: 1,
      },
    });
  }, []);

  return <section ref={sectionRef}>Scroll-triggered content</section>;
}

Timeline Sequence

import { useGSAPTimeline } from '@tuel/gsap';

function SequenceAnimation() {
  const { timeline } = useGSAPTimeline();

  useEffect(() => {
    timeline
      .from('.hero-title', { 
        opacity: 0, 
        y: 50, 
        duration: 1 
      })
      .from('.hero-subtitle', { 
        opacity: 0, 
        y: 30, 
        duration: 0.8 
      }, '-=0.5')
      .from('.hero-cta', { 
        opacity: 0, 
        scale: 0.8, 
        duration: 0.6 
      }, '-=0.4');
  }, []);

  return (
    <div className="hero">
      <h1 className="hero-title">Welcome</h1>
      <p className="hero-subtitle">Subtitle</p>
      <button className="hero-cta">Get Started</button>
    </div>
  );
}

Hover Animation

function HoverCard() {
  const cardRef = useRef(null);

  useGSAP(() => {
    const card = cardRef.current;

    card.addEventListener('mouseenter', () => {
      gsap.to(card, {
        scale: 1.05,
        duration: 0.3,
        ease: 'power2.out',
      });
    });

    card.addEventListener('mouseleave', () => {
      gsap.to(card, {
        scale: 1,
        duration: 0.3,
        ease: 'power2.out',
      });
    });
  }, []);

  return <div ref={cardRef} className="card">Hover me</div>;
}

TypeScript Support

Full TypeScript support:

import type { GSAPTimelineOptions } from '@tuel/gsap';

Performance

  • Automatic cleanup prevents memory leaks
  • GSAP's optimized rendering engine
  • GPU acceleration for transforms
  • Efficient DOM manipulation

Browser Support

  • Chrome/Edge 90+
  • Firefox 88+
  • Safari 14+
  • All browsers supported by GSAP

Contributing

See CONTRIBUTING.md for development setup and guidelines.

License

MIT © Omer Akben

Links