Element.startViewTransition() starts a same-document (SPA) element-scoped view transition and returns a ViewTransition object (MDN). DOM updates in the callback animate only inside that element’s subtree — the rest of the page stays interactive.
Pass the required arguments shown below. Check return values and browser support before you rely on the result.
Syntax
Call el.startViewTransition. Start with this line.
JavaScript
element.startViewTransition()
Call
What it does
element.startViewTransition()
Primary signature.
el.startViewTransition(...)
Call with the arguments your case needs.
Built into the browser. Call startViewTransition(...) on an Element — no import required.
Library declarations
JavaScript
element.startViewTransition()
Parameters
Parameter
Description
updateCallback
Optional. Update the element’s DOM; may return a Promise
options.update
Optional. Same callback via an options object
options.types
Optional. String tags for selective CSS/JS (default [])
Pass an options object.update is the DOM callback.
Set types. Labels this transition (default []).
Use types in CSS/JS for different animation styles (MDN).
Keep a reference to the returned ViewTransition if you need it.
Compatibility
Browser Support
Element.startViewTransition() is Experimental with Limited availability on MDN (not Baseline). Feature-detect and provide an instant DOM-update fallback.
✓ Experimental · Limited
Element.startViewTransition()
Element-scoped View Transitions — growing support, not universal yet.
—Limited
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
Android WebViewSupported · Modern WebView
Full support
startViewTransition()Limited
Bottom line: Detect typeof el.startViewTransition === "function". Prefer element scope for local widgets; use document.startViewTransition for full-page SPA transitions.
Frequently Asked Questions
It starts a same-document (SPA) element-scoped view transition on an element's DOM subtree and returns a ViewTransition object (MDN). DOM updates inside the callback animate only within that element's scope.
MDN marks Element.startViewTransition() as Experimental and Limited availability (not Baseline). It is not Deprecated or Non-standard.
A ViewTransition object instance representing the transition (MDN).
Optional function that updates the element's DOM during the transition. It may return a Promise; the transition begins when that promise fulfills. If it rejects, the transition is abandoned (MDN).
Document.startViewTransition() is document-scoped and makes the whole page non-interactive during the transition. Element.startViewTransition() scopes the transition to one element's subtree — the rest of the page stays interactive (MDN).
An optional array of strings naming the transition types, so you can apply selective CSS or JS based on which transition is running (MDN). Defaults to an empty array.