stackpicks.dev
Back to gallery
pmndrs/react-spring preview
pmndrs
pmndrs/

react-spring

✌️ A spring physics based React animation library

Stars
29.1k
Forks
1.2k
Watchers
29.1k
Open issues
141
TypeScriptMIT next Updated 13 minutes ago~10 stars/day lifetime
Editor's take

Physics-based spring animations for React. ~29k stars. Better than Motion when you need genuinely physical motion (interruptible drags, momentum scrolls). Less DX polish than Motion for the common cases.

Use this if

You are building interruptible drag interactions, momentum-based UI, or physics-feeling motion.

Skip if

You want declarative tween-based animations — Motion is easier.

Animation & Motion
Topics
animation-libraryreactreact-springspring-physicssprings
Quick install
# Install via npm / pnpm / bun:
pnpm add react-spring
# or
npm install react-spring

Inferred from TypeScript · always double-check against the official README below.

README — rendered from pmndrs/react-spring


react-spring

A spring-physics first animation library
giving you flexible tools to confidently cast your ideas


Chat on Discord


react-spring is a cross-platform spring-physics first animation library.

It's as simple as:

const styles = useSpring({
  from: {
    opacity: 0
  },
  to: {
    opacity: 1
  }
})

<animated.div style={styles} />

Just a small bit about us:

  • Cross-Platform: We support react-dom, react-native, react-three-fiber, react-konva & react-zdog.
  • Versatile: Be declarative with your animations or if you prefer, imperative.
  • Spring-Physics First: By default animation use springs for fluid interactivity, but we support durations with easings as well.

There's a lot more to be had! Give it a try and find out.

Getting Started

⚡️ Jump Start

# Install the entire library
npm install react-spring
# or just install your specific target (recommended)
npm install @react-spring/web
import { animated, useSpring } from '@react-spring/web'

const FadeIn = ({ isVisible, children }) => {
  const styles = useSpring({
    opacity: isVisible ? 1 : 0,
    y: isVisible ? 0 : 24,
  })

  return <animated.div style={styles}>{children}</animated.div>
}

It's as simple as that to create scroll-in animations when value of isVisible is toggled.

📖 Documentation and Examples

More documentation on the project can be found here.

Pages contain their own examples which you can check out there, or open in codesandbox for a more in-depth view!


📣 What others say

Used by

And many others...

Backers

Thank you to all our backers! 🙏 If you want to join them here, then consider contributing to our Opencollective.

Contributors

This project exists thanks to all the people who contribute.

Live data via GitHub REST API · Cached 30 min · Created 07 Mar 2018