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.

Open
Follow the link. The two pages crossfade, the header holds still, and the readout says yes. In Firefox the page changes at once.
Code CSS · 1 line
@view-transition { navigation: auto; }
Why it works, the rules and the credits 1 reason · 2 rules · support · credits

Why it works

  1. 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

  1. Both pages must include the rule.
  2. 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