Skip to content
Web Design & Development

A Practical Guide to View Transitions

A browser API that animates between two states of a page, or between pages, by capturing snapshots and cross-fading or morphing elements.

Marcus Adeyemi Technical Director 2 min read 26 views
A Practical Guide to View Transitions

Why does it matter?

It makes navigation feel app-like with little code, and cross-document transitions work even on multi-page sites.

What are the numbers?

  • Same-document transitions started with document.startViewTransition()
  • Cross-document transitions enabled with the @view-transition CSS rule
  • Naming elements view-transition-name links elements across states
  • Reduced motion transitions should respect prefers-reduced-motion

What should I do?

  1. Start with a simple cross-fade
  2. Name only the elements that should morph
  3. Disable or simplify transitions for reduced motion
  4. Treat transitions as progressive enhancement
  5. Test on slower devices
What to do and what to avoid with view transitions, side by side
Good practice against the usual mistakes, from the sources listed below.

What should I avoid?

Avoid:

  • Long transitions that slow navigation
  • Duplicate view-transition-name values on one page
  • Transitions that hide slow page loads
  • Ignoring browsers without support

When should I get help?

Short answer Bring in help when adding animated navigation to a site, or when transitions cause visual glitches.

Where this comes from

The figures and practices above come from the sources listed.

Working on something like this?

We take on Web Design & Development work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.

Where to go next

Spotted something wrong? Report an error on this page. We correct on the page and say what changed.

All services

The work behind this article, and what it costs.

Marcus Adeyemi

Builds and maintains the web work. Writes about front-end architecture, performance, accessibility and the unglamorous parts of keeping a site alive.

Keep reading

More in Web Design & Development