Element.activeViewTransition is a read-only instance property that returns the ViewTransition currently active on an element, or null if none is running. Learn why it exists next to Element.startViewTransition(), how to feature-detect it, and how it differs from document-scoped transitions—with five examples and try-it labs.
01
Kind
Read-only property
02
Returns
ViewTransition | null
03
Status
Experimental
04
Scope
Element-scoped VT
05
Start via
startViewTransition()
06
API family
View Transition
Fundamentals
Introduction
The View Transition API can animate DOM updates. With element-scoped transitions you call element.startViewTransition(callback) so only that element’s subtree is captured—the rest of the page can stay interactive.
Sometimes you start a transition in one function and later need the same ViewTransition object (for example to call skipTransition() or await finished). MDN: activeViewTransition gives a consistent way to read the active transition without saving the return value yourself.
If you still hold the return value from startViewTransition(), that is fine. activeViewTransition helps when that reference was not stored, or when another module needs the same ongoing transition.
Concept
Understanding the Property
MDN: the activeViewTransition read-only property of the Element interface returns a ViewTransition instance representing the view transition currently active on an element.
Read-only — you read it; you do not assign to it.
Value — ViewTransition while active, otherwise null.
Experimental — Limited availability (not Baseline) on MDN.
Pair with — Element.startViewTransition() for element-scoped transitions.
Foundation
📝 Syntax
JavaScript
activeViewTransition
Value
A ViewTransition, or null if the element has no active view transition.
Compare
⚖️ Element vs Document scope
API
Scope
Typical start
element.activeViewTransition
That element’s subtree
element.startViewTransition(…)
document.activeViewTransition
Document-scoped transition
document.startViewTransition(…)
Element-scoped transitions are useful for cards, lists, and widgets that animate without freezing the whole page. Always confirm both startViewTransition and activeViewTransition exist on your target.
Pairing
🔗 With Element.startViewTransition()
MDN’s basic example starts a transition, then notes you can read activeViewTransition while it is still ongoing:
JavaScript
const myElement = document.querySelector(".my-element");
function handleVT() {
const vt = myElement.startViewTransition(() => {
// updateDOMSomehow();
});
}
// Returns a reference to vt if the transition is still ongoing
myElement.activeViewTransition;
Cheat Sheet
⚡ Quick Reference
Goal
Code / note
Read active VT
el.activeViewTransition
Idle / none
null
Start element-scoped
el.startViewTransition(() => { … })
Feature-detect
"activeViewTransition" in Element.prototype
Skip animation
el.activeViewTransition?.skipTransition()
MDN status
Experimental · Limited availability
Snapshot
🔍 At a Glance
Four facts about Element.activeViewTransition.
Kind
read-only
Instance
Returns
VT | null
ViewTransition
Status
experimental
Not Baseline
API
View Trans.
Element scope
Hands-On
Examples Gallery
Examples follow MDN Element: activeViewTransition. Labs feature-detect first. Starting a real transition needs a supporting browser and Element.startViewTransition.
📚 Getting Started
Detect the property and read the idle null state.
Example 1 — Feature-Detect Safely
Check whether activeViewTransition exists on elements.
JavaScript
console.log({
hasActiveViewTransition: "activeViewTransition" in Element.prototype,
hasStartViewTransition: typeof Element.prototype.startViewTransition === "function",
tip: "Element.activeViewTransition is experimental — feature-detect first."
});
Many browsers still report false here. Treat missing support as normal and update the DOM without a view transition.
Example 2 — Idle Value Is null
Before any transition starts, the property should be null when present.
JavaScript
const el = document.createElement("div");
document.body.appendChild(el);
if (!("activeViewTransition" in el)) {
console.log("activeViewTransition not supported");
} else {
console.log({
activeViewTransition: el.activeViewTransition,
note: "null means no element-scoped transition is active"
});
}
Either approach works. Prefer keeping the return value when you only need it in the same function; use the property when another place needs the ongoing transition.
Example 5 — Element vs Document Snapshot
See which active-transition hooks this browser exposes.
JavaScript
console.log({
elementProp: "activeViewTransition" in Element.prototype,
elementStart: typeof Element.prototype.startViewTransition,
documentProp: "activeViewTransition" in Document.prototype,
documentStart: typeof document.startViewTransition,
documentActiveNow: document.activeViewTransition ?? null,
status: "Element.activeViewTransition is experimental (element-scoped VT)"
});
Element.activeViewTransition is Experimental and not Baseline. It belongs to element-scoped View Transitions. 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.activeViewTransition
ViewTransition or null — the active element-scoped view transition.
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
activeViewTransitionLimited
Bottom line: Detect the property and Element.startViewTransition before use. Prefer storing the return value when convenient; use activeViewTransition when you need the ongoing transition later. Never require view transitions for core UX.
Wrap Up
Conclusion
Element.activeViewTransition is an experimental read-only handle for the element-scoped ViewTransition currently running on an element—or null when idle. Feature-detect, pair it with startViewTransition(), and always keep a non-animated update path.
A ViewTransition instance for the view transition currently active on that element, or null if none is active.
MDN marks Element.activeViewTransition as Experimental and Limited availability (not Baseline). It is not Deprecated or Non-standard.
Yes. You read it to get the active ViewTransition (or null). You do not assign a transition to the property.
Element.startViewTransition() starts an element-scoped transition and returns a ViewTransition. activeViewTransition lets you read that ongoing transition later without keeping your own reference.
When the element has no active view transition—before one starts, after it finishes, or if the API is unsupported / the call never ran.
Related idea, different scope. Document.activeViewTransition is for document-scoped transitions. Element.activeViewTransition is for element-scoped transitions on that element.
Did you know?
Element-scoped view transitions can run concurrently on different elements because each transition is rooted on its own scope. That is one reason a per-element activeViewTransition property is useful—each widget can inspect its own in-flight transition independently.