framer-motion vs react-spring vs react-three-fiber vs remotion
Advanced Animation and Motion Libraries for React Applications
framer-motionreact-springreact-three-fiberremotionSimilar Packages:

Advanced Animation and Motion Libraries for React Applications

framer-motion, react-spring, react-three-fiber, and remotion are specialized libraries for adding motion, interactivity, and 3D graphics to React applications. framer-motion is a production-ready motion library focused on declarative animations and gesture handling for DOM elements. react-spring is a physics-based animation library that interpolates values using spring dynamics for natural movement. react-three-fiber is a React renderer for Three.js, enabling 3D scene construction using React components. remotion is a framework for creating videos programmatically using React, allowing developers to render video content from code rather than traditional editing software.

Npm Package Weekly Downloads Trend

3 Years

Github Stars Ranking

Stat Detail

Package
Downloads
Stars
Size
Issues
Publish
License
framer-motion034,7778.01 MB142 days agoMIT
react-spring029,2617.23 kB785 months agoMIT
react-three-fiber033,418-286 years agoMIT
remotion0-1.98 MB-7 days agoSEE LICENSE IN LICENSE.md

Advanced Animation and Motion Libraries for React: A Technical Deep-Dive

When building modern React applications, motion is no longer just an afterthoughtβ€”it is a core part of the user experience. The ecosystem offers specialized tools for different kinds of motion: DOM-based UI animations, physics-driven interactions, 3D WebGL rendering, and programmatic video generation. framer-motion, react-spring, react-three-fiber, and remotion each solve distinct problems. Let's compare how they handle animation logic, rendering targets, and developer experience.

🎬 Animation Engine: Declarative vs Physics vs Renderer

framer-motion uses a declarative API where you define the "from" and "to" states.

  • It handles the interpolation internally using optimized engines.
  • Great for layout shifts and standard UI transitions.
// framer-motion: Declarative animation
import { motion } from "framer-motion";

function Box() {
  return (
    <motion.div
      initial={{ opacity: 0, y: 20 }}
      animate={{ opacity: 1, y: 0 }}
      transition={{ duration: 0.5 }}
    />
  );
}

react-spring uses physics-based springs to interpolate values.

  • You define tension and friction instead of duration.
  • Values update continuously based on physics simulation.
// react-spring: Physics-based animation
import { useSpring, animated } from "@react-spring/web";

function Box() {
  const props = useSpring({
    from: { opacity: 0, transform: "translateY(20px)" },
    to: { opacity: 1, transform: "translateY(0px)" },
    config: { tension: 280, friction: 60 }
  });
  return <animated.div style={props} />;
}

react-three-fiber is a renderer, not just an animation library.

  • It renders Three.js scenes using React components.
  • Animations are often handled via useFrame or external libraries like @react-spring/three.
// react-three-fiber: 3D Rendering loop
import { Canvas, useFrame } from "@react-three/fiber";

function RotatingBox() {
  const ref = useRef();
  useFrame(() => (ref.current.rotation.x += 0.01));
  return <mesh ref={ref}><boxGeometry /><meshStandardMaterial /></mesh>;
}

function App() {
  return <Canvas><RotatingBox /></Canvas>;
}

remotion renders video frames programmatically.

  • It calculates state per frame number.
  • Used for generating video files, not live browser interaction.
// remotion: Frame-based video rendering
import { AbsoluteFill, useCurrentFrame } from "remotion";

function Video({ title }) {
  const frame = useCurrentFrame();
  const opacity = frame / 30; // Fade in over 30 frames
  return (
    <AbsoluteFill style={{ justifyContent: "center", alignItems: "center" }}>
      <h1 style={{ opacity }}>{title}</h1>
    </AbsoluteFill>
  );
}

πŸ–ΌοΈ Rendering Target: DOM vs WebGL vs Video File

The target output defines which library fits your architecture.

  • framer-motion targets the DOM. It animates HTML/CSS properties directly. It supports SVG and layout animations via layoutId.
  • react-spring targets DOM, SVG, or WebGL. It is universal but often paired with DOM elements or Three.js meshes.
  • react-three-fiber targets WebGL (Canvas). It creates a 3D context. It does not animate HTML elements directly without bridging libraries.
  • remotion targets Video Files. It renders React components into frames that are stitched into a video file (MP4/WebM) via CLI or cloud rendering.
// framer-motion: DOM Layout Animation
<motion.div layoutId="card" /> // Morphs between locations

// react-three-fiber: WebGL Mesh
<mesh position={[0, 0, 0]} /> // Renders in Canvas

// remotion: Video Composition
<Composition id="MyVideo" component={Video} durationInFrames={100} />

⚑ Performance and Interactivity

framer-motion optimizes for UI responsiveness.

  • It uses hardware acceleration for transforms and opacity.
  • Includes built-in gesture support (drag, pan, tap).
// framer-motion: Gesture support
<motion.div drag dragConstraints={{ left: 0, right: 300 }} />

react-spring optimizes for smooth value interpolation.

  • It avoids layout thrashing by animating transforms where possible.
  • Ideal for high-frequency updates like mouse tracking.
// react-spring: Mouse tracking
const [props, api] = useSpring(() => ({ xy: [0, 0] }));
const update = useCallback(({ clientX: x, clientY: y }) => api({ xy: [x, y] }), [api]);

react-three-fiber optimizes for 3D scene graph management.

  • It handles disposal of geometries and materials automatically.
  • Performance depends on WebGL draw calls and shader complexity.
// react-three-fiber: Automatic disposal
// No manual cleanup needed for meshes when unmounting
<mesh geometry={new THREE.BoxGeometry()} />

remotion optimizes for render speed and reproducibility.

  • It does not run in real-time; it renders frames as fast as the CPU/GPU allows.
  • Interactivity is limited to previewing; final output is static video.
// remotion: Preview vs Render
// <Player /> component for browser preview
// CLI command for actual video rendering

πŸ”„ State Management and Timing

Timing models differ significantly between live animation and video generation.

framer-motion uses time-based transitions.

  • You specify duration, ease, and delay.
  • State changes trigger animations automatically.
// framer-motion: Time-based
transition={{ duration: 0.8, ease: "easeInOut" }}

react-spring uses value-based interpolation.

  • You specify start/end values and physics config.
  • Time is a byproduct of the physics simulation.
// react-spring: Value-based
config: { mass: 1, tension: 170, friction: 26 }

react-three-fiber uses frame-based loops.

  • useFrame runs on every requestAnimationFrame.
  • You manually update state based on delta time.
// react-three-fiber: Frame loop
useFrame((state, delta) => {
  ref.current.rotation.x += delta;
});

remotion uses absolute frame numbers.

  • useCurrentFrame() returns the current frame index.
  • Timing is deterministic based on FPS (e.g., 30fps).
// remotion: Frame-based
const frame = useCurrentFrame();
const progress = frame / 60; // 2 seconds at 30fps

πŸ› οΈ Ecosystem and Integration

All four libraries integrate deeply with React, but their ecosystems serve different needs.

1. UI Components & Variants

  • framer-motion has a rich set of pre-built variants and works seamlessly with component libraries like Chakra UI or Material UI.
  • react-spring requires more manual setup for complex sequences but offers greater control over interpolation.
// framer-motion: Variants
const variants = { hidden: { opacity: 0 }, visible: { opacity: 1 } };
<motion.div variants={variants} />

2. 3D Assets & Loaders

  • react-three-fiber has a dedicated ecosystem (@react-three/drei) for loaders, controls, and helpers.
  • framer-motion and react-spring do not handle 3D assets natively.
// react-three-fiber: Asset loading
import { useGLTF } from "@react-three/drei";
const { nodes } = useGLTF("/model.glb");

3. Video & Media

  • remotion is the only option for generating actual video files from React code.
  • Others are for browser-based interaction only.
// remotion: CLI Rendering
// npx remotion render src/index.tsx MyVideo out/video.mp4

πŸ“Š Summary: Key Differences

Featureframer-motionreact-springreact-three-fiberremotion
Primary TargetDOM / HTMLDOM / Values / WebGLWebGL / 3D CanvasVideo File (MP4/WebM)
Animation ModelDeclarative (Time-based)Physics (Spring-based)Frame Loop (Delta-based)Frame Index (Deterministic)
InteractivityHigh (Gestures, Drag)High (Mouse, Touch)High (3D Controls)Low (Preview only)
Best ForUI Transitions, LayoutsNatural Motion, Draggables3D Scenes, ProductsProgrammatic Video Creation
Learning CurveLowMediumHigh (WebGL knowledge helps)Medium

πŸ’‘ The Big Picture

framer-motion is the standard for UI motion. If you are building a dashboard, landing page, or web app and need elements to fade, slide, or drag, this is the default choice. It balances power with simplicity.

react-spring is the choice for physics. If your interface needs to feel "alive" with bounce, tension, or continuous interpolation that reacts to user velocity, spring physics provide a more organic feel than time-based transitions.

react-three-fiber is the bridge to 3D. If your requirements exceed 2D CSS transforms and require lighting, cameras, or 3D models, this is the only React-native solution that scales to production WebGL applications.

remotion is for video. If your goal is not to animate a website but to generate video assets (like personalized marketing clips or social media posts) using React logic, Remotion transforms your components into renderable video frames.

Final Thought: These libraries are not mutually exclusive. A single application might use framer-motion for UI transitions, react-three-fiber for a 3D hero section, and remotion to generate a promotional video of that same 3D scene. Choose based on the output medium: DOM, Physics, WebGL, or Video.

How to Choose: framer-motion vs react-spring vs react-three-fiber vs remotion

  • framer-motion:

    Choose framer-motion when you need robust, declarative animations for standard DOM elements with minimal setup. It is ideal for UI interactions like layout transitions, hover effects, and gesture-based controls (drag, swipe) where performance and ease of use are priorities. It excels in production applications requiring reliable SSR support and a rich set of pre-built animation variants.

  • react-spring:

    Choose react-spring if your application requires physics-based animations that feel natural and responsive to user input. It is best suited for complex interactive interfaces where values need to interpolate smoothly based on velocity and tension, such as draggable cards, dynamic modals, or data visualizations that need to react to state changes without rigid timelines.

  • react-three-fiber:

    Choose react-three-fiber when your project involves 3D graphics, WebGL, or immersive experiences within a React application. It is the standard choice for rendering 3D models, handling cameras, lights, and shaders using React's component model. Use this for product configurators, games, or data visualizations that require three-dimensional space rather than 2D DOM manipulation.

  • remotion:

    Choose remotion if your goal is to generate video content programmatically using React components. It is designed for creating marketing videos, social media clips, or dynamic video templates where content changes based on data. Use this when you need to render video files (MP4, WebM) from code rather than animating elements live in the browser for user interaction.

README for framer-motion

Motion logo
Motion for React

An open source animation library
for React

npm version npm downloads per month jsDelivr hits (npm) NPM License MotionScore grade

npm install motion

Table of Contents

  1. Why Motion?
  2. 🍦 Platforms
  3. πŸŽ“ Examples
  4. 🎨 Motion Studio
  5. πŸ€– Using Motion with AI
  6. ⚑️ Motion+
  7. πŸ‘©πŸ»β€βš–οΈ License
  8. πŸ’Ž Contribute
  9. ✨ Sponsors

Why Motion?

  • Simple API: First-class React, JavaScript, and Vue packages.
  • Hybrid engine: Power of JavaScript combined with native browser APIs for 120fps, GPU-accelerated animations.
  • Production-ready: TypeScript, extensive test suite, tree-shakable, tiny footprint. Batteries included: Gestures, springs, layout transitions, scroll-linked effects, timelines.

🍦 Platforms

Motion is available for React, JavaScript and Vue.

React

import { motion } from "motion/react"

function Component() {
    return <motion.div animate={{ x: 100 }} />
}

Get started with Motion for React.

Note: Framer Motion is now Motion. Import from motion/react instead of framer-motion.

JS

import { animate } from "motion"

animate("#box", { x: 100 })

Get started with JavaScript.

Vue

<script>
    import { motion } from "motion-v"
</script>

<template> <motion.div :animate={{ x: 100 }} /> </template>

Get started with Motion for Vue.

πŸŽ“ Examples & tutorials

Browse 450+ official examples, with copy-paste code that'll level-up your animations whether you're a beginner or an expert.

Over 110 examples come with a full step-by-step tutorial on their example page.

πŸ€– Using Motion with AI

Give your coding agent current Motion docs:

  • Agent skill: npx motion-ai installs the free, MIT-licensed /motion skill and sets up Motion's MCP servers for Claude Code, Cursor, Amp, OpenCode, Gemini CLI and Copilot. Source on GitHub.
  • MCP server: https://mcp.motion.dev searches the Motion docs and example metadata. It is free and needs no account.
  • llms.txt: motion.dev/llms.txt indexes every docs page. Motion+ pages are labelled as paid, with their install and import.

Motion+ adds example and Motion UI source, MotionScore performance audits and CSS spring generation for your agent.

🎨 Motion Studio

A visual animation editor for your website. Edit keyframes, easing curves and springs on a live timeline, or describe changes to the Ultramotion agent, then apply the result straight to your code with Cursor, Codex or Claude.

Explore Motion Studio

⚑️ Motion+

A one-time Personal licence with lifetime updates, or an annual per-seat Business plan for teams:

  • 450+ examples
  • 110+ tutorials
  • Premium APIs like Cursor and Ticker
  • Transition editor for Cursor and VS Code
  • AI Kit: example and Motion UI source, MotionScore audits and CSS springs for your agent
  • Private Discord
  • Early access content

Get Motion+

πŸ‘©πŸ»β€βš–οΈ License

  • Motion is MIT licensed.

πŸ’Ž Contribute

✨ Sponsors

Motion is sustainable thanks to the kind support of its sponsors.

Become a sponsor

Partners

Motion powers the animations for all websites built with Framer, the web builder for creative pros. The Motion website itself is built on Framer, for its delightful canvas-based editing and powerful CMS features.

Framer

Motion drives the animations on the Cursor homepage, and is working with Cursor to bring powerful AI workflows to the Motion examples and docs.

Cursor

Platinum

Linear Figma Sanity Clerk

Gold

Silver

Liveblocks Frontend.fyi Firecrawl Bolt.new

Personal