RE

React

@gsap/react

Tools for using GSAP in React, like useGSAP() which is a drop-in replacement for useLayoutEffect()/useEffect()

Animation
react
gsap
useeffect
uselayouteffect
usegsap
animation
greensock
javascript
@gsap/react
npm
Stars
1
Weekly
0
Open issues
0
Bundle
~60 kB

Installation

npm install @gsap/react

Code example

import { motion } from "@gsap/react";

export function Example() {
  return (
    <motion.div
      initial={{ opacity: 0, y: 12 }}
      animate={{ opacity: 1, y: 0 }}
      transition={{ duration: 0.35 }}
    >
      <h2>Animated with React</h2>
    </motion.div>
  );
}

Pros & cons

Pros

  • Actively maintained by Jack Doyle
  • 0 weekly downloads. Battle tested
  • First-class TypeScript definitions
  • SEE LICENSE AT https://gsap.com/standard-license licensed

Considerations

  • Adds roughly ~60 kB to your bundle
  • Needs client-only rendering in SSR frameworks
  • Not supported in React Native
  • 0 open issues on GitHub

FAQs

Alternatives & similar libraries