:active-view-transition CSS pseudo-class

Baseline 2025
Newly available

Since October 2025, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

The :active-view-transition CSS pseudo-class matches the root element of a document when a view transition is in progress (active) and stops matching once the transition has completed.

Syntax

css
:root:active-view-transition ... {
  /* ... */
}

Examples

Styling an active view transition

This example extends the Basic view transition example on the startViewTransition page.

html
<main>
  <section class="color">
    <h2>Color is changing!</h2>
  </section>
  <button id="change-color">Change Color</button>
</main>

A <h2> element initially has a display: none style, and this is overwritten using the :active-view-transition pseudo-class setting the <h2> style to display: block. The button is hidden using visibility: hidden, when the view transition is in progress:

css
h2 {
  display: none;
  color: white;
}
:root:active-view-transition h2 {
  display: block;
}
:root:active-view-transition button {
  visibility: hidden;
}

Specifications

Specification
CSS View Transitions Module Level 2
# the-active-view-transition-pseudo

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
:active-view-transition
Chrome – Full support
Chrome 125 (Release date: 2024-05-14)
footnote
footnote See bug 40276317
Edge – Full support
Edge 125 (Release date: 2024-05-17)
footnote
footnote See bug 40276317
Firefox – Full support
Firefox 144 (Release date: 2025-10-14)
footnote Full support
Opera – Full support
Opera 111 (Release date: 2024-06-12)
footnote
footnote See bug 40276317
Safari – Full support
Safari 18 (Release date: 2024-09-16)
footnote Full support
Chrome Android – Full support
Chrome Android 125 (Release date: 2024-05-14)
footnote
footnote See bug 40276317
Firefox for Android – Full support
Firefox for Android 144 (Release date: 2025-10-14)
footnote Full support
Opera Android – Full support
Opera Android 83 (Release date: 2024-06-25)
footnote
footnote See bug 40276317
Safari on iOS – Full support
Safari on iOS 18 (Release date: 2024-09-16)
footnote Full support
Samsung Internet – Full support
Samsung Internet 27 (Release date: 2024-11-06)
footnote
footnote See bug 40276317
WebView Android – Full support
WebView Android 125 (Release date: 2024-05-14)
footnote
footnote See bug 40276317
WebView on iOS – Full support
WebView on iOS 18 (Release date: 2024-09-16)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
See implementation notes.

See also