Element.startViewTransition() is an instance method that starts an element-scoped view transition on a DOM subtree and returns a ViewTransition object. Learn MDN’s slideshow demo, the updateCallback and options.types parameters, how it differs from document.startViewTransition(), pairing with activeViewTransition, and five try-it labs aligned with MDN.
01
Kind
Instance method
02
Returns
ViewTransition
03
Scope
Element subtree
04
Callback
updateCallback
05
Types
options.types
06
Status
Experimental
Fundamentals
Introduction
View transitions animate DOM updates smoothly instead of swapping content instantly. You may already know document.startViewTransition(), which scopes a transition to the entire page. element.startViewTransition() scopes it to one element’s subtree (MDN).
That means only the scoped region becomes non-interactive during the animation; the rest of the page keeps working. You can run multiple element-scoped transitions at once, and clipped overflow content stays clipped (MDN).
💡
Beginner tip
Pass a callback that updates the element’s DOM. The browser snapshots the old state, runs your callback, then animates to the new state. If startViewTransition is missing, call the same update function directly (MDN slideshow pattern).
Calling el.startViewTransition(updateCallback) creates a view transition rooted on el. Only DOM changes inside that element’s subtree are animated (MDN).
It is an instance method on Element.
Returns a ViewTransition object instance (MDN).
updateCallback (optional) — updates DOM during the transition; may return a Promise (MDN).
options.update — same as updateCallback when using the options object form (MDN).
options.types — array of transition type strings for selective CSS/JS styling (MDN).
If the callback’s Promise rejects, the transition is abandoned (MDN).
Pseudo-elements like ::view-transition-group(root) are placed inside the transition root (MDN).
Foundation
📝 Syntax
General form of Element.startViewTransition (MDN):
Element.startViewTransition() is Experimental and not Baseline on MDN. It belongs to element-scoped View Transitions (CSS View Transitions Module Level 2). Always feature-detect and keep a plain DOM-update fallback. Logos use the shared browser-image-sprite.png sprite from this project.
✓ Experimental · Not Baseline
Element.startViewTransition()
Start element-scoped view transitions — returns a ViewTransition object.
LimitedExperimental
Google ChromeElement-scoped VT — check current versions
Limited / Check
Microsoft EdgeFollow Chromium View Transition support
Limited / Check
OperaFollow Chromium where available
Limited / Check
Mozilla FirefoxMay lag or lack element-scoped APIs — detect
Limited
Apple SafariCheck current Safari — feature-detect
Limited
Internet ExplorerNo View Transition API
No
startViewTransition()Limited
Bottom line: Detect typeof el.startViewTransition === "function" before use. Keep instant DOM updates as fallback. Do not require view transitions for core UX.
Wrap Up
Conclusion
Element.startViewTransition() animates DOM updates scoped to one element. MDN’s slideshow pattern: feature-detect, call the same update without the API as fallback, and return a ViewTransition you can await or read via activeViewTransition.
Update DOM outside the scoped element and expect animation
Ignore rejected Promises in async callbacks (MDN)
Assume Baseline support — check MDN compatibility
Block the whole page when an element scope is enough
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about Element.startViewTransition()
Element-scoped animations for SPA widgets and slideshows.
5
Core concepts
📝01
Returns
ViewTransition
API
🌐02
Scope
element
Subtree
⚙️03
Callback
update
DOM
📈04
Fallback
detect
Enhance
🔬05
Status
experimental
Limited
❓ 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 invoked to update 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).
startViewTransition() returns a ViewTransition you can store. element.activeViewTransition reads the currently active transition on that element (or null) without keeping your own reference.
Did you know?
MDN notes that element-scoped view transitions let you run more than one transition at a time on different elements, and only the scoped region becomes non-interactive — unlike document-scoped transitions that freeze the entire page.