back to home

pmndrs / react-spring

✌️ A spring physics based React animation library

29,044 stars
1,214 forks
134 issues
TypeScriptJavaScriptShell

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing pmndrs/react-spring in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind-ai.vercel.app/repo/pmndrs/react-spring)
Preview:Analyzed by RepoMind

Repository Summary (README)

Preview
<h2 align="center" style="font-size: 10px"> <sup> Special thanks to: </sup> </h2> <a href="http://go.warp.dev/react-spring"> <p align="center"> <img src="https://github.com/warpdotdev/brand-assets/blob/main/Github/Sponsor/Warp-Github-LG-02.png?raw=true" width="320" /> </p> <p align="center" style="color: white; font-size: 14px"> Warp is built for coding with multiple AI agents </p> </a> <hr /> <br /> <p align="center"> <img src="https://i.imgur.com/QZownhg.png" width="240" /> </p> <br /> <h1 align="center">react-spring</h1> <h3 align="center">A spring-physics first animation library <br>giving you flexible tools to confidently cast your ideas</h3> <br> <p align="center"> <a href="https://www.npmjs.com/package/react-spring" target="_blank"> <img src="https://img.shields.io/npm/v/react-spring.svg?style=flat&colorA=000000&colorB=000000" /> </a> <a href="https://www.npmjs.com/package/react-spring" target="_blank"> <img src="https://img.shields.io/npm/dm/react-spring.svg?style=flat&colorA=000000&colorB=000000" /> </a> <a href="https://discord.gg/AXfNsGx64f" target="_blank"> <img src="https://img.shields.io/discord/740090768164651008?style=flat&colorA=000000&colorB=000000&label=discord&logo=discord&logoColor=ffffff" alt="Chat on Discord"> </a> </p> <br>

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

<p align="middle"> <img src="assets/testimonies.jpg" /> </p>

Used by

<p align="middle"> <a href="https://nextjs.org/"><img width="285" src="assets/projects/next.png"></a> <a href="https://codesandbox.io/"><img width="285" src="assets/projects/csb.png"></a> <a href="https://aragon.org/"><img width="285" src="assets/projects/aragon.png"></a> </p>

And many others...

Backers

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

<a href="https://opencollective.com/react-spring#backers" target="_blank"> <img src="https://opencollective.com/react-spring/backers.svg?width=890"/> </a>

Contributors

This project exists thanks to all the people who contribute.

<a href="https://github.com/react-spring/react-spring/graphs/contributors"> <img src="https://opencollective.com/react-spring/contributors.svg?width=890" /> </a>