JavaScript Element activeViewTransition Property

Beginner
⏱️ 12 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Experimental
Instance property

What You’ll Learn

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

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.

JavaScript
const box = document.querySelector(".my-element");
console.log(box.activeViewTransition); // null when idle (if supported)
💡
Beginner tip

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.

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.
  • ValueViewTransition while active, otherwise null.
  • Experimental — Limited availability (not Baseline) on MDN.
  • Pair withElement.startViewTransition() for element-scoped transitions.

📝 Syntax

JavaScript
activeViewTransition

Value

A ViewTransition, or null if the element has no active view transition.

⚖️ Element vs Document scope

APIScopeTypical start
element.activeViewTransitionThat element’s subtreeelement.startViewTransition(…)
document.activeViewTransitionDocument-scoped transitiondocument.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.

🔗 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;

⚡ Quick Reference

GoalCode / note
Read active VTel.activeViewTransition
Idle / nonenull
Start element-scopedel.startViewTransition(() => { … })
Feature-detect"activeViewTransition" in Element.prototype
Skip animationel.activeViewTransition?.skipTransition()
MDN statusExperimental · Limited availability

🔍 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

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."
});
Try It Yourself

How It Works

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"
  });
}
Try It Yourself

How It Works

After a transition finishes, the property goes back to null again.

📈 Start, Compare & Snapshot

Pair with startViewTransition when the browser allows it.

Example 3 — Start Then Read (Safe Demo)

MDN idea: start a transition, then read activeViewTransition.

JavaScript
const myElement = document.createElement("div");
myElement.textContent = "Hello";
document.body.appendChild(myElement);

if (typeof myElement.startViewTransition !== "function") {
  console.log("startViewTransition not supported; update DOM without VT");
  myElement.textContent = "Updated";
} else {
  myElement.startViewTransition(() => {
    myElement.textContent = "Updated";
  });
  console.log({
    hasActive: myElement.activeViewTransition != null,
    constructorName: myElement.activeViewTransition
      ? myElement.activeViewTransition.constructor.name
      : null
  });
}
Try It Yourself

How It Works

Timing matters: if you read after finished, you may already see null. Reading immediately after start is the usual check.

Example 4 — Same Object as the Return Value

Confirm activeViewTransition matches what startViewTransition returned.

JavaScript
const el = document.createElement("section");
document.body.appendChild(el);

if (typeof el.startViewTransition !== "function") {
  console.log("Cannot compare — startViewTransition missing");
} else {
  const vt = el.startViewTransition(() => {
    el.dataset.state = "b";
  });
  console.log({
    sameReference: el.activeViewTransition === vt,
    tip: "Store vt or re-read activeViewTransition later"
  });
}
Try It Yourself

How It Works

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)"
});
Try It Yourself

How It Works

Document-scoped APIs landed earlier in some engines. Element-scoped support can lag behind—detect each separately.

🚀 Common Use Cases

  • Skip or finish an in-flight element-scoped transition from another module.
  • Await finished / ready without threading the return value everywhere.
  • Guard UI actions while activeViewTransition != null.
  • Teaching element-scoped vs document-scoped View Transitions.
  • Debugging whether a widget still has an active transition.

🔧 How It Works

1

Call startViewTransition on an element

Callback updates that element’s DOM subtree.

Start
2

Browser runs the view transition

Snapshots and animates within the element scope.

Animate
3

activeViewTransition points at it

Same ViewTransition you can also keep from the return value.

Read
4

Settles back to null

When the transition ends (or is skipped), the property clears.

📝 Notes

  • Experimental and Limited availability (MDN)—experimental banner shown above.
  • Not Deprecated or Non-standard on MDN.
  • Read-only; value is ViewTransition or null.
  • Different from document.activeViewTransition (document scope).
  • Related: startViewTransition(), Node, EventTarget, JavaScript hub.

Limited / Experimental Support

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.

Limited Experimental
Google Chrome Element-scoped VT — check current versions
Limited / Check
Microsoft Edge Follow Chromium View Transition support
Limited / Check
Opera Follow Chromium where available
Limited / Check
Mozilla Firefox May lag or lack element-scoped APIs — detect
Limited
Apple Safari Check current Safari — feature-detect
Limited
Internet Explorer No View Transition API
No
activeViewTransition Limited

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.

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.

Continue with startViewTransition(), ariaActiveDescendantElement, or the JavaScript hub.

💡 Best Practices

✅ Do

  • Feature-detect activeViewTransition and startViewTransition
  • Fall back to plain DOM updates when unsupported
  • Treat null as idle (no active transition)
  • Use optional chaining for helpers like ?.skipTransition()
  • Respect prefers-reduced-motion when designing animations

❌ Don’t

  • Assign to activeViewTransition (it is read-only)
  • Assume every browser supports element-scoped transitions
  • Require view transitions for core product flows
  • Confuse it with document.activeViewTransition
  • Skip checking MDN compatibility for production apps

Key Takeaways

Knowledge Unlocked

Five things to remember about activeViewTransition

Experimental element-scoped ViewTransition accessor.

5
Core concepts
🎬 02

ViewTransition

or null

Value
🔬 03

Experimental

not Baseline

Status
🔗 04

Pairs with

startViewTransition

API
🎯 05

Fallback

plain DOM update

UX

❓ Frequently Asked Questions

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.

Next: ariaActiveDescendantElement

Learn the ARIA active descendant element reference property.

ariaActiveDescendantElement →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful