document.startViewTransition() starts a same-document (SPA), document-scoped view transition and returns a ViewTransition object (MDN). You pass an update callback that changes the DOM after the browser snapshots the old view.
Pass the required arguments shown below. Check return values and browser support before you rely on the result.
Syntax
Call document.startViewTransition. Start with this line.
Slide
(types applied when the engine supports the options form)
How It Works
Options form accepts update instead of a bare function (MDN).
types tags the transition for selective styles or logic.
Defaults:update is null, types is [] (MDN).
Still detect first — older engines may only accept the callback form (or none).
Compatibility
Browser Support
Document.startViewTransition() is a browser View Transition API. MDN marks it Baseline 2025 Newly available (since October 2025). Older browsers may lack it — feature-detect and update the DOM immediately as a fallback.
✓ Baseline 2025 · Newly available
Document.startViewTransition()
Same-document SPA view transitions. Supported in the latest major browsers. Always detect before calling.
MDN: Document.startViewTransition() starts a new same-document (SPA), document-scoped view transition and returns a ViewTransition object to represent it.
No. MDN marks Document.startViewTransition() as Baseline Newly available (since October 2025). It is not Deprecated, Experimental, or Non-standard on the Document page. Always feature-detect for older browsers.
A ViewTransition object instance (MDN).
Optional function invoked to update the DOM during the SPA view transition. It returns a Promise. The callback runs after a snapshot of the current page; when the promise fulfills, the transition begins in the next frame. If it rejects, the transition is abandoned (MDN).
Document.startViewTransition() is document-scoped (whole-page same-document transitions). Element.startViewTransition() scopes the transition to one element’s subtree so the rest of the page can stay interactive (MDN).
Yes. Always feature-detect. If document.startViewTransition is missing, update the DOM immediately without animation (MDN basic usage pattern).