View Transitions
Two demos, two techniques — both built on the same browser API.
Shared elements · <ViewTransition name="...">
◈Shared Elements
Avatar and title morph from post list to detail view — same page, no routes.
About the API
The View Transitions API lets browsers animate between two DOM states — capturing a snapshot before and after a change, then animating ::view-transition-old and ::view-transition-new pseudo-elements with CSS. No animation library required.
Full-page
- 1.Call
startViewTransition({ types })manually - 2.Browser activates :active-view-transition-type()
- 3.CSS keyframes animate old/new root snapshots
Shared elements
- 1.
<ViewTransition name="id">wraps the element in both pages - 2.React detects matching names across state changes
- 3.Browser interpolates size, position, and crossfade automatically
Chrome 111+ · Edge 111+ · Safari 18.2+ · Firefox in progress