Animate everything with Framer Motion.
Framer Motion is a library for animating HTML and SVG elements in React.
The Mighty Motion Guide explains how to use it with many example projects.
Play Video
Last update: December 26, 2023
200+
CodeSandboxes
57,000+
words of detailed explanations
In this guide:
How to use Motion elements. Free — Check out 32 example projects. Free — How to use the
animate
, transition
, and initial
properties. Free — Add hover, tap, drag, and focus animations with one line of code. — Define predefined visual states with variants, use them to make child elements animate automatically, and orchestrate those child animations. — Use keyframes to create animation sequences and adjust their timing and animation curves. — Use predefined easing curves, custom Bézier curves, and default or duration-based spring curves. — Animate elements just before they’re removed from the DOM tree, make something happen just after such an animation, and animate elements in and out by changing their key. — Cycle through a set of predefined animation states, animate to a specific state instead of the next one, or cycle through a set of ‘variants’. — Layout Animations: animate elements by simply changing their dimensions or position, solve possible problems with child elements or CSS classes, customize these animations or synchronize the layout animations of different elements. — Shared Layout Animations: animate from one element to another or animate to a newly added element. — How to track animations by injecting Motion values, how to display these Motion values, transform them or use them to track the scroll position of a webpage, track the scroll position of a scrollable element, or track where an element is in the viewport. — Animate these Motion values. — Create springy Motion values. — Start animations manually with the useAnimate()
hook, animate sub-elements, start, stop, pause them, and create staggered animations and animation sequences. — And you can still use the useAnimationControls()
hook to start animations manually. — Animate SVG paths, line draw SVG paths and other elements, and animate SVG gradients. — Make any HTML element draggable, limit its axis or lock its direction, define how far you can drag it and how it should act beyond these constraints, decide if you can throw it, tweak its ‘inertia’ animations, decide where it should end up after these animations, track drag actions with different events, control a draggable element with another element, or make a draggable element snap to a grid or a corner. — New Create a list of items you can reorder by dragging. Make a horizontal list, add and remove items, or make only part of an item draggable. — Combine React Router and Framer Motion to create animations between webpages. — Check the different properties you can animate. And an overview of all the API’s properties, drag properties, events, special components, hooks for Motion values, and other utilities. Free What people say
These are testimonials for my other guide: The Framer Book.
The Framer book has always been my go-to resource when making something in Framer. It’s incredible how well written the book is.
It’s clear a ton of craftsmanship went into creating design exemplars, intuitive written and visual guides, and thorough technical documentation with concise, richly annotated code snippets and even interactive “sandboxes” to try things out myself.
The Framer book is well laid out and easy to understand, especially from a developer standpoint.
Seriously concise info about Framer that covers most of what you want to learn. Tes has a great way of explaining a broad range of concepts from simple to more complex.
Tes’ book is my go-to resource for everything to do with Framer. The detailed explanations with accompanying code examples really helps you get to grips with Framer and React. Highly recommended!
With the Framer book, I have a reliable source which is incredibly well made. Structure and writing are just excellent.
This clear and example-rich book gave me a deeper understanding of Framer and React. As a designer, I nowadays enjoy opening up the Code tab to design by code.
Framerbook is the hidden Framer manual I always turn to. It keeps up to date with Framer’s changes and is extremely well written.
The Framer book is like a magic cheatsheet for when I get stuck.
Shuo Yanghttps://cargocollective.com/frommainland
Hi there!
I am Tes Mat
I’m a web and iOS developer who was looking for the best prototyping tool. I tried a bunch of them, liked Framer (Classic) the most, and wrote a manual about it, and then another one about the current Framer.
I’m from Belgium but almost always live abroad. Lately, I’ve spent some years in Kyiv, Ukraine (also learning Russian), where I’ve also taught Framer at Projector. But now I’m spending time in Brazil (so now it’s Portuguese).