Entry 05
Cross-document view transitions
Use it on any multi-page site to crossfade between pages. It replaces a client-side router or a page-transition script.
Code
@view-transition { navigation: auto; }Why it works, the rules and the credits
Why it works
- On a same-origin navigation the browser snapshots the old and new page and crossfades them. Parts that do not change, such as the header, appear to stay in place.
Rules
- Both pages must include the rule.
- The default crossfade adds no movement and needs no reduced-motion guard. If you add slides, put the rule inside
@media (prefers-reduced-motion: no-preference).
Support
- Chrome
- 126
- Safari
- 18.2
Firefox navigates as normal.
Credits
Borrowed from: Jen Simmons and James Craig, Two lines of Cross-Document View Transitions code you can use on every website today, 2025-05-21 · Bramus Van Damme, Cross-document view transitions for multi-page applications