In the Skill's Own Terms
A guide for animating between UI states with React's View Transition API: declare what with the ViewTransition component, trigger when with startTransition, useDeferredValue or Suspense, and control how with CSS classes. It covers five patterns in a fixed priority order, shared element morphs, list identity, state change and route change, plus type-keyed directional navigation through addTransitionType and Next.js App Router integration.
It explains where a ViewTransition boundary must sit, when default="none" is required, which browsers support it (Chromium 125+, Firefox 144+, Safari 18.2+) with graceful degradation elsewhere, and points to reference files for implementation order, CSS recipes, patterns and troubleshooting.
What it produces
- A reusable directional wrapper component that holds the type-keyed enter and exit maps for multi-page apps.
- Shared element morphs created by reusing the same name on the unmounting and mounting views, for example a thumbnail that becomes a hero image.
- CSS rules keyed to the view transition pseudo-elements, including the image pair that holds both snapshots.
- An implementation that degrades gracefully, where unsupported browsers skip the animation instead of breaking navigation.
How It Works
- 01Work Out What the Animation Says
Only add a boundary when you can articulate the spatial relationship or continuity it expresses. If you cannot say what it communicates, do not add it.
- 02Wrap the State in a Boundary
React assigns a unique view-transition-name and calls document.startViewTransition behind the scenes, so you never call startViewTransition yourself.
- 03Trigger It with a Transition
Enter, exit, update and share only fire from startTransition, useDeferredValue or Suspense. A plain setState will not animate anything.
- 04Style the Snapshots in CSS
The outgoing and incoming snapshots are targeted through view transition pseudo-elements carrying your own class names, with the recipes file supplying ready-made animations.
- 05Tag It with Transition Types
addTransitionType stacks context types so different boundaries in the tree react differently, and a per-type object maps those types to CSS classes on enter, exit and share.