Shared element transition

Also called hero animation, magic move, or shared layout animation

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.

What is Shared element transition?

In a shared element transition, the same item appears on two screens, and the change between them animates that item from its old position and size to its new one. Tap a photo in a grid and it expands into the large photo on the detail view; close it and it shrinks back into its tile. The rest of the screen usually fades around it.

It helps people keep their place, because they can see where the detail view came from and where it will return. It is common in photo galleries, product grids, music apps, and any list that opens into a detail view. Flutter calls it a Hero animation, and Keynote calls a similar effect Magic Move.

On the web, Motion does this with layoutId: give the thumbnail and the detail image the same ID, and Motion animates between them when one replaces the other. The browser’s View Transitions API does the same with view-transition-name. Keep it around 300 to 500ms, and make sure closing lands the element exactly back in its tile.

Often confused with

Morph
A morph reshapes one element in place. A shared element transition carries an element from one view to another.
All terms

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.

View Transitions API

A browser feature that animates between two states of a page by snapshotting the old view, applying your update, and animating to the new one.

Page transition

An animation that plays when you move from one page or screen to another, such as the old page fading out as the new one fades in.

Spatial consistency

Moving elements in ways that match where things live in the interface, so people can tell where an item went and how to find it again.