Layout animation

Also called FLIP animation or auto layout animation

An animation that smoothly moves and resizes elements when the layout changes, such as list items gliding to new spots after a sort or filter.

What is Layout animation?

When items are added, removed, sorted, or resized, the browser normally jumps everything to its new position in a single frame. A layout animation measures where each element was before the change and where it ends up after, then animates the difference so items glide into place.

Use it for lists that reorder or filter, grids that change columns, cards that expand, tabs with a sliding indicator, and anywhere an instant jump would make people lose track of an item. It is also the engine behind most morphs and shared element transitions.

The classic technique is called FLIP: First, Last, Invert, Play. Measure the first position, apply the change, measure the last position, invert the difference with a transform, then animate that transform back to zero. Because only transform animates, it stays smooth even though the real layout changed instantly. Motion does all of this when you add the layout prop, and AnimatePresence handles items that leave.

Often confused with

Morph
A morph is one element changing shape. Layout animation is the general technique that animates any element whose position or size changed, and morphs are often built with it.
All terms

Shared element transition

A transition where an element from one view, like a thumbnail, travels and grows into its place in the next view, linking the two screens.

Drag to reorder

A list you can rearrange by dragging an item to a new spot while the other items slide aside to make room.

Height auto animation

An animation that opens or closes a panel to the exact height of its content, even though that height is unknown ahead of time.

GPU acceleration

A browser technique where the graphics chip moves, fades, or scales an element on its own layer instead of redrawing the page every frame.