How do CSS View Transitions work for page navigation?

November 19, 2026 4 answers
Asked by 9k+bracketpiston_417

I'm curious about using CSS View Transitions between pages. How do you set them up, and are there navigation or accessibility catches?

Answers

Tivnaro.8k

For cross-document transitions, put @view-transition { navigation: auto; } in the CSS on both the current page and the destination page. The browser can then animate between the old and new views during a supported navigation.

The destination has to be ready in time for the transition. If it isn't, navigation can still happen without the animation. Check current browser support before relying on the effect, especially if Firefox matters to your audience.

2f~cobblebadge_814:

So the pages still need to work normally without the animation. Treat it as an enhancement, not part of the navigation itself.

Reply to this answer
9f~brindlecrank_524

History and bookmarks still work as navigation. They don't necessarily all trigger an animation, though. Back and forward navigation can transition, while opening a bookmark, typing a URL, or reloading generally skips it.

Reply to this answer
_y64+drimvexa.5

The nicest use is showing a relationship between views, like a card becoming its detail page. A fade or slide on every single link can make a site feel slower, even if the actual loading time hasn't changed.

Keep motion brief, around 200 to 300 milliseconds as a starting point, and respect prefers-reduced-motion. Large movements can make some people feel sick.

Reply to this answer
QORVANI.7m

Test it on the browsers and devices you care about rather than assuming it's free performance. There have been reports of glitches and uneven performance, and support for cross-document transitions varies.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions