TL;DR: Cross-document view transitions let a plain multi-page site fade and morph between pages the way a single-page app does, turned on with one CSS rule in both documents involved. Named transitions animate specific shared elements, such as a thumbnail growing into a hero image, and support now spans Chromium browsers and Firefox. The one non-negotiable: always respect prefers-reduced-motion.
What Problem Does the View Transitions API Actually Solve?
Every click on a classic multi-page link does the same thing under the hood: the browser discards the current render, shows a blank white frame, fetches the new document, and paints it from scratch. On a fast connection that gap is a few milliseconds; on a slow one it's a visible flash that resets scroll position and makes even a well-designed site feel like a stack of disconnected documents rather than one product.
Single-page apps solved this years ago by never actually navigating: a JavaScript router swaps DOM nodes in place and animates the swap. That fix came at a real cost, though, a client-side router, a bigger bundle, and a category of bugs around scroll restoration and back-button behavior that server-rendered sites don't have to think about. Teams building content-heavy, mobile-first sites, including the kind of mobile web project YuSMP's mobile development team builds for clients, have historically had to pick one: the simplicity of plain navigation, or the polish of an app-like transition.
The View Transitions API removes that trade-off. Cross-document view transitions bring SPA-style animated navigation to ordinary multi-page sites, with no router and no bundle, because the browser itself captures the before-and-after states and runs the animation.
How Cross-Document View Transitions Work
When a navigation is eligible for a view transition, the browser fires a pageswap event on the document you're leaving, right before it captures a snapshot of that page's visual state. Once the new document starts loading, it fires a pagereveal event, right before that page is first rendered. Both events expose a ViewTransition object if a transition is actually going to run, which is how custom behavior gets hooked into either side of the navigation.
Between those two events, the browser does the heavy lifting on its own: snapshot the old page, render the new page underneath, then crossfade between them using generated pseudo-elements. No JavaScript is required for this default behavior; the entire effect is a single CSS declaration.
Enabling It on a Multi-Page Site in One CSS Rule
The opt-in lives in CSS, and it has to be present in both the page you're navigating away from and the page you're navigating to. Same-origin is also required; a transition never crosses domains, even between two sites you control.
/* in the stylesheet of every page that should transition */
@view-transition {
navigation: auto;
}
That's the entire minimal implementation. With nothing else added, same-origin navigations between pages carrying this rule get a default fade, roughly 250ms, in place of the hard cut. If a visitor lands on, or navigates away to, a page that doesn't carry the rule, the browser just performs a normal navigation; there's nothing to break.
Named Transitions — Animating Shared Elements Across Pages
A plain fade is already an improvement, but the more compelling pattern is animating one specific element smoothly between its position on the old page and its position on the new one, for example a list thumbnail growing into a detail page's hero image. That's done with the view-transition-name property.
/* on the list/index page */
.thumb { view-transition-name: product-hero; }
/* on the detail page, same name */
.hero { view-transition-name: product-hero; }
When the browser sees a matching view-transition-name on both sides of a navigation, it treats that element as a single continuous object and morphs its size and position between the two states instead of fading it. Each named element gets its own set of generated pseudo-elements: ::view-transition-group() wraps the whole animated pairing, while ::view-transition-old() and ::view-transition-new() style the outgoing and incoming snapshots independently. Two related properties, view-transition-class and view-transition-scope, apply shared styling across a group of named elements without hand-naming every one.
What About Single-Page Apps? (document.startViewTransition())
Everything above assumes a real navigation between two documents. A single-page app doesn't have that, it swaps DOM content with JavaScript, so there's no browser-level navigation event to hook into. For that case the API has a JavaScript-driven counterpart:
document.startViewTransition(() => {
// synchronously update the DOM however your app normally does
renderNextView();
});
The browser snapshots the current state, runs the callback, snapshots the result, and animates between the two, the same underlying mechanism as the cross-document version, just invoked manually. If the pages are genuinely separate documents, the CSS-only route is simpler; inside a client-side router, startViewTransition() is the equivalent entry point.
Is the View Transitions API Accessible by Default?
No, and this is easy to skip under a deadline. During a transition, snapshots of old and new content exist simultaneously in a generated overlay, which can confuse focus handling, interrupt a screen reader's reading position, and fire motion some visitors have explicitly told their devices not to show them. None of that is automatic. The one non-negotiable fix is respecting the prefers-reduced-motion media query:
@media (prefers-reduced-motion: reduce) {
@view-transition {
navigation: auto;
}
::view-transition-group(*),
::view-transition-old(*),
::view-transition-new(*) {
animation: none !important;
}
}
This keeps the transition technically active while removing the motion itself for anyone who's told their OS they don't want it. It's also worth testing navigations with <link rel="expect" href="#main-content"> on the incoming page, which holds off the first paint until that element has parsed, so the transition's "new" snapshot doesn't momentarily flash an empty page.
Browser Support in 2026 — Who Can Use This Today?
Cross-document view transitions shipped in Chromium starting with Chrome 126, which puts Chrome, Edge, and Opera on the same baseline; Firefox has since shipped its own implementation of the feature. Coverage keeps moving, so check a current compatibility table before committing to anything beyond the basic opt-in rule.
What makes this safe to adopt early is that it's inherently progressive enhancement. A browser that doesn't recognize @view-transition ignores the declaration and performs the navigation it always would have. No fallback code, no feature-detection branch; unsupported browsers get the same site they'd have gotten before the rule was added.
Common Mistakes When Adding View Transitions
- Forgetting
prefers-reduced-motion. Treat the reduced-motion override as part of the initial implementation, not a follow-up accessibility pass. - Naming too many elements. Giving every tile on a grid its own
view-transition-name multiplies the number of generated pseudo-elements the browser has to track, which costs real paint performance for marginal visual benefit. - Assuming it works cross-origin. It doesn't, and won't; a transition to a different domain or subdomain always falls back to a normal navigation.
- Skipping the critical-content check. Without
<link rel="expect"> pointing at the content that has to be present before first paint, the incoming snapshot can briefly show an empty shell mid-transition.
Frequently Asked Questions About View Transitions
Do I need JavaScript for view transitions on a multi-page site?
No. Cross-document view transitions on a traditional multi-page site are opt-in through a single CSS rule, @view-transition { navigation: auto; }, placed in the stylesheet of every page that should animate. JavaScript only becomes necessary if you want to go beyond the default fade, for example reading or adjusting the transition through the pageswap and pagereveal events.
Which browsers support cross-document view transitions in 2026?
Chromium-based browsers, Chrome, Edge, and Opera, have supported cross-document view transitions since Chrome 126, and Firefox has shipped its own implementation. Check an up-to-date compatibility table before shipping, but the realistic floor in 2026 is every major engine having some form of the feature.
How do I animate a shared image between two pages?
Give the image the same view-transition-name value on both the page it starts on and the page it ends on. When the browser detects a matching name across the outgoing and incoming documents, it automatically morphs the element's position and size between the two states instead of just fading it.
Does the View Transitions API work across different domains?
No. Cross-document view transitions are a same-origin feature. Navigating to a different domain or subdomain, even one you also control, falls back to a normal hard navigation with no transition, and the CSS opt-in rule has to exist on both the source and destination documents, not just one.
What happens in browsers that don't support the API?
Nothing breaks. A browser that doesn't recognize the @view-transition rule simply ignores it and performs the navigation it always would have. Supporting browsers get the smoother experience, everyone else gets the exact same site they'd have gotten anyway.
How do I respect prefers-reduced-motion?
Wrap the transition-related rules in an @media (prefers-reduced-motion: reduce) query and disable the generated pseudo-element animations with animation: none on ::view-transition-group, ::view-transition-old, and ::view-transition-new. Since old and new content can't coexist meaningfully for someone relying on a screen reader or reduced motion, this isn't optional polish, it's a baseline requirement.
Can I combine view transitions with a JavaScript framework like React or Next.js?
Yes, the two models are complementary. A single-page app built with React or a similar framework uses the JavaScript-driven document.startViewTransition() method to wrap its own DOM updates, since there's no real page navigation for the browser to intercept. A framework rendering genuinely separate documents can use the CSS-only cross-document approach described above instead.
None of this requires rebuilding a site's architecture. The View Transitions API is shaped so a single CSS rule gets the baseline improvement, with named transitions and JavaScript hooks available only for cases that need them. For a multi-page site that's already fast and well-structured, it closes one of the last gaps between "feels like a document" and "feels like an app," without asking for a router in exchange. Source: MDN's View Transition API documentation.