← Back to release summary

activeViewTransition property on document

Category
JavaScript
Type
New or changed feature
Status
Proposed (Chrome Proposed)
Intent stage
None

Summary

View Transitions API allows developers to start visual transitions between different states. The primary SPA entry point to this is `startViewTransition()` which returns a transition object. This object contains several promises and functionality to track the transition progress, as well as allow manipulations such as skipping the transition or modifying its types. The proposal here is ergonomic in nature: instead of requiring that users store this object in some sort of way for easy access, provide a `document.activeViewTransition` property that represents this object, or null if there is no transition ongoing. Note this similarly applies to MPA transitions, where the object is only available via `pageswap` and `pagereveal` events. In this proposal `document.activeViewTransition` would be set to this object for the duration of the transition.

Standards & signals

Explainers: https://github.com/WICG/view-transitions/blob/main/active-view-transition.md

View on chromestatus.com