Web Dev Academy Animation & scroll · Framer Motion Tool 25 / 64
Animation & scroll

Framer Motion

A declarative animation library for React (now shipped as "Motion"). You describe states and transitions on motion.* components and it handles springs, gestures, drag and layout animation for you.

Demo 01

Spring physics with animate

Framer Motion's default transition is a real spring — not a fixed-duration tween. Toggle the target and watch it settle naturally, with overshoot and damping.

<motion.div
  animate={{ x: on ? 260 : 0, rotate: on ? 90 : 0 }}
  transition={{ type: "spring", stiffness: 300, damping: 18 }} />
Demo 02

Drag with constraints & momentum

Add drag to a component and it becomes throwable. It respects dragConstraints and snaps back with a spring. Grab and fling the tile.

Demo 03

Shared layout animation

Give items a layout prop and Framer Motion animates position changes automatically. Click any row to move it to the top — the others smoothly reflow.

Demo 04

AnimatePresence: enter & exit

Normally React just removes elements. Wrap them in <AnimatePresence> and Framer Motion plays an exit animation first. Add and remove cards below.

Demo 05

Gesture states: whileHover & whileTap

Declarative gesture props animate to a target while the user hovers or presses — no event handlers required.

i
Built with the real Framer Motion / Motion library running on React 18, all loaded as UMD bundles from cdn.jsdelivr.net (react, react-dom, framer-motion) and compiled in-browser with Babel Standalone. Every spring, drag, layout and AnimatePresence demo above is genuine Framer Motion. If the React bundles fail to load, the page shows a notice — the code shown is exactly what runs.

↑ All 64 tools