explaingit

chenglou/react-motion

21,930JavaScriptAudience · developerComplexity · 2/5DormantLicenseSetup · easy

TLDR

A React library that animates UI elements using spring physics instead of fixed timings, creating natural, smooth motion by configuring stiffness and damping values.

Mindmap

mindmap
  root((react-motion))
    What it does
      Spring physics animations
      Smooth transitions
      Natural movement
    Core components
      Motion single element
      StaggeredMotion cascading
      TransitionMotion enter exit
    Use cases
      Draggable lists
      Chat bubbles
      Photo galleries
    Tech stack
      React JavaScript
      React Native mobile
      npm package

Things people build with this

USE CASE 1

Build draggable lists and reorderable interfaces with smooth, physics-based motion.

USE CASE 2

Create chat bubble animations and message transitions that feel natural and responsive.

USE CASE 3

Animate photo galleries and image carousels with cascading entrance effects.

USE CASE 4

Add water ripple effects and interactive UI feedback that responds like real-world physics.

Tech stack

JavaScriptReactReact Native

Getting it running

Difficulty · easy Time to first run · 5min
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

React-Motion is a JavaScript library for adding animations to web applications built with React. Instead of telling an element exactly how long to animate and what path to follow, you describe the animation using "spring physics", the same principles that govern how a real spring moves. You set two values called stiffness and damping, and the library calculates the natural, smooth motion automatically. The core concept is that you don't hard-code timings or easing curves (those are the math formulas that control how an animation speeds up and slows down). Instead, you configure a virtual spring by choosing how stiff or bouncy it should be. React-Motion provides handy presets like "gentle" or "wobbly" so you can pick a feel without worrying about the math. The library then smoothly transitions any numeric value, position, size, opacity, between a starting point and a destination. It offers three main building blocks. The basic Motion component animates a single element. StaggeredMotion animates a list of related items where each item's movement depends on the one before it, creating a natural cascading effect. TransitionMotion handles elements that are appearing or disappearing from the page, giving them smooth entrance and exit animations. Someone would reach for this library when building polished web interfaces where standard CSS transitions feel too rigid or choppy. Demos in the README include draggable lists, chat bubbles, photo galleries, and water ripples, all cases where physics-based movement looks more natural than a fixed-duration transition. It works with both React for web and React-Native for mobile apps. The library is written in JavaScript and installed via npm.

Copy-paste prompts

Prompt 1
Show me how to use react-motion to animate a list of items where each one follows the previous one with a cascading effect.
Prompt 2
How do I configure the stiffness and damping values in react-motion to make an animation feel bouncy versus smooth?
Prompt 3
Give me a code example of using react-motion's TransitionMotion to smoothly animate elements appearing and disappearing from the page.
Prompt 4
How can I use react-motion to create a draggable element that snaps back to its original position with spring physics?
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.