Overview
Shared-element transitions morph a thumbnail into a larger detail page, keeping a visual through-line across what would otherwise feel like an abrupt navigation. The View Transitions API turns this into a one-line browser primitive: tag two elements with the same view-transition-name on the old and new pages, and the browser handles the cross-fade, the size morph, and the position translate as part of a single transaction.
When to use it
Reach for shared-element transitions when the user is moving between two views of the same content at different fidelities — a gallery card to a detail page, a search result to its full record, a feed item to its conversation thread. The morph is the visual proof that “this is the same thing, just bigger.” Skip it for navigations between unrelated views (home → settings); a regular page transition reads more honestly there.
How it works
The API snapshots the old DOM, paints the new DOM, then interpolates between the two snapshots over a configurable duration. Elements with a matching view-transition-name are paired and animated together; everything else cross-fades. You can hook into the animation with ::view-transition-old(name) and ::view-transition-new(name) pseudo-elements to customize the timing or curve. The same-document FLIP fallback in this pattern kicks in for engines without API support, measuring the from/to rectangles and faking the morph via transform: translate + scale.
Production gotchas
Two elements with the same name on the page simultaneously will throw — make sure only one is mounted at a time, or scope the name to instance IDs. The fallback FLIP measurement happens on layout, so applying it to elements inside flex containers with min-width: 0 can produce zero-width “from” frames. Pause any other animations on the morphing elements during the transition window or they will fight the interpolation.
Accessibility
The browser respects prefers-reduced-motion: reduce automatically — the morph skips and only the cross-fade plays. For screen reader users the DOM transition is functionally instant. Keep your focus management on the new page; the API does not move focus for you.
References
Implementation depth
Shared element motion should prove identity between two views. The same thumbnail, title, or metadata block needs a stable view-transition-name on both sides, otherwise the browser falls back to a generic crossfade and the user loses the visual through-line.
Treat the FLIP fallback as a compatibility layer, not a second design. Measure from and to rectangles once, animate transform and scale only, then let the destination DOM own layout again so focus, headings, and landmarks remain normal after navigation.