Working Draft · css-view-transitions

CSS View Transitions Module

4 properties, 1 at-rule, 8 selectors defined by this specification, all known to at least one browser .

Each feature in detail

view-transition-class

Property Baseline: newly availablesince October 2025 Modern CSS: view-transition-class

MDN The view-transition-class CSS property provides the selected elements with one or more identifying classes (custom-idents), providing an additional method of styling the view transitions for those elements.

Live preview Example from MDN
/* Each element must have a unique view-transition-name */
#card1 {
  view-transition-name: card-1;
}

#card2 {
  view-transition-name: card-2;
}

#card3 {
  view-transition-name: card-3;
}

/* But they can all share the same view-transition-class */
.card {
  view-transition-class: card;
}

/* This single rule applies to all three cards' transitions */
::view-transition-group(.card) {
  animation-duration: 0.5s;
  animation-timing-function: ease-in-out;
}

Syntax

none | <custom-ident>+

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
none
Applies to
all elements
Inherited
no
Percentages
n/a
Computed value
as specified
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting view-transition-class
Chrome 125
Edge 125
Firefox 144
Safari 18.2
Chrome Android 125
Safari iOS 18.2

First version with support, from MDN browser-compat-data.

view-transition-group

Property Experimental

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

normal | contain | nearest | <custom-ident>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
normal
Applies to
all elements
Inherited
no
Percentages
n/a
Computed value
as specified
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting view-transition-group
Chrome 140
Edge 140
Firefox No
Safari No
Chrome Android 140
Safari iOS No

First version with support, from MDN browser-compat-data.

view-transition-name

Property Baseline: newly availablesince October 2025 Modern CSS: View transitions

MDN The view-transition-name CSS property specifies the view transition snapshot that selected elements will participate in. This enables you to animate those elements separately from the rest of the page, which uses the default cross-fade animation during a view transition. You can then define custom animation styles for these elements.

Live preview Example from MDN
/* General styles and resets */
* {
  box-sizing: border-box;
  font-size: 0.9rem;
}

html {
  font-family: "Helvetica", "Arial", sans-serif;
  height: 100%;
}

body {
  margin: 0;
  height: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}
li h2 {
  margin: 0;
}

ul {
  padding: 0;
  margin: 0;
  list-style-type: none;
}

li {
  overflow: hidden;
  container-type: inline-size;
}

li p {
  display: none;
}

li.active-item p {
  display: block;
}

li:nth-child(1) {
  background-color: #cbc0d3;
  border: 20px solid #cbc0d3;
}

li:nth-child(2) {
  background-color: #efd3d7;
  border: 20px solid #efd3d7;
}

li:nth-child(3) {
  background-color: #feeafa;
  border: 20px solid #feeafa;
}

li:nth-child(4) {
  background-color: #dee2ff;
  border: 20px solid #dee2ff;
}

/* Links */

a {
  text-decoration: none;
  color: rgb(0 0 255 / 0.8);
}

a:hover,
a:focus {
  color: rgb(100 100 255);
}

/* Form and checkbox styles */
form {
  position: absolute;
  bottom: 0;
  right: 0;
  z-index: 2;
  background-color: white;
  padding: 10px;
  border: 1px solid black;
}

main {
  container-type: inline-size;
  width: 100%;
  height: 100%;
  display: flex;
  gap: 2cqw;
  position: relative;
}

ul {
  width: 35cqw;
  display: flex;
  flex-direction: column;
  gap: 1cqw;
}

article {
  flex: 1;
}

li {
  flex: 1;
}

.active-item {
  position: absolute;
  z-index: 1;
  translate: 37cqw;
  width: calc(100% - 37cqw);
  height: 100%;
}

.match-element-applied li {
  view-transition-name: match-element;
}

::view-transition-group(*) {
  animation-duration: 0.5s;
}

html::view-transition-old(*),
html::view-transition-new(*) {
  height: 100%;
}

Syntax

none | <custom-ident>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
none
Applies to
all elements
Inherited
no
Percentages
n/a
Computed value
as specified
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting view-transition-name
Chrome 111
Edge 111
Firefox 144
Safari 18
Chrome Android 111
Safari iOS 18

First version with support, from MDN browser-compat-data.

view-transition-scope

Property Limited availability Experimental Modern CSS: Element-scoped view transitions

MDN The view-transition-scope CSS property enables the discoverability of elements with view-transition-name values set on them (and therefore the creation of view transition snapshots) to be isolated to a specific element subtree.

Live preview Example from MDN
body {
  font: 1.2em / 1.5 sans-serif;
  width: 50%;
  max-width: 700px;
  margin: 0 auto;
}

section,
.change-me {
  border: 2px solid #666666;
  padding: 10px;
}

section {
  background-color: orange;
}

.change-me {
  background-color: white;
  view-transition-name: para-change;
  view-transition-scope: all;
}

::view-transition-group(para-change) {
  animation-duration: 1s;
}

Syntax

none | all

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
none
Applies to
all elements
Inherited
no
Percentages
n/a
Computed value
as specified
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting view-transition-scope
Chrome 147
Edge 147
Firefox No
Safari No
Chrome Android 147
Safari iOS No

First version with support, from MDN browser-compat-data.

@view-transition

At-rule Limited availability Modern CSS: Cross-document view transitions

MDN The @view-transition CSS at-rule is used to opt in the current and destination documents to undergo a view transition, in the case of a cross-document navigation.

Syntax

@view-transition { <declaration-list> }

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting @view-transition
Chrome 126
Edge 126
Firefox No
Safari 18.2
Chrome Android 126
Safari iOS 18.2

First version with support, from MDN browser-compat-data.

Descriptors

navigation
auto | none Initial: none
types
none | <view-transition-type>+ Initial: none

::view-transition

Selector Baseline: newly availablesince October 2025 Modern CSS: View transitions

Spec The ::view-transition pseudo-element is a fully styleable pseudo-element that is also a pseudo-element root. If its originating element is the document’s document element, its containing block is the snapshot containing block.

MDN The ::view-transition CSS pseudo-element represents the root of the view transitions overlay, which contains all view transition snapshot groups and sits over the top of all other page content.

Syntax

::view-transition

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting ::view-transition
Chrome 109
Edge 109
Firefox 144
Safari 18
Chrome Android 109
Safari iOS 18

First version with support, from MDN browser-compat-data.

::view-transition-group-children()

Selector Experimental

Spec The ::view-transition-group-children() pseudo-element is created when mandated by the view-transition-group property on either the element itself or on its contained element. It serves as a container for descendant view-transition-group() pseudo-elements. By default, it is sized to the same size as the corresponding view-transition-group() pseudo element. By default, it has a transparent border that matches the size and shape of the border on the element that caused this structure to be created.

Browser support

First browser version supporting ::view-transition-group-children()
Chrome 140
Edge 140
Firefox No
Safari No
Chrome Android 140
Safari iOS No

First version with support, from MDN browser-compat-data.

::view-transition-group()

Selector Baseline: newly availablesince October 2025 Modern CSS: View transitions

Spec The ::view-transition-group() pseudo-element is a named view transition pseudo-element that represents a matching named view transition capture. A ::view-transition-group() pseudo-element is generated for each view transition name as a child of the ::view-transition pseudo-element, and contains a corresponding ::view-transition-image-pair().

MDN The ::view-transition-group() CSS pseudo-element represents a single view transition snapshot group.

Browser support

First browser version supporting ::view-transition-group()
Chrome 109
Edge 109
Firefox 144
Safari 18
Chrome Android 109
Safari iOS 18

First version with support, from MDN browser-compat-data.

::view-transition-image-pair()

Selector Baseline: newly availablesince October 2025 Modern CSS: View transitions

Spec The ::view-transition-image-pair() pseudo-element is a named view transition pseudo-element that represents a pair of corresponding old/new view transition captures. This pseudo-element is a child of the corresponding ::view-transition-group() pseudo-element and contains a corresponding ::view-transition-old() pseudo-element and/or a corresponding ::view-transition-new() pseudo-element (in that order).

MDN The ::view-transition-image-pair() CSS pseudo-element represents a container for a view transition's "old" and "new" view states — before and after the transition.

Browser support

First browser version supporting ::view-transition-image-pair()
Chrome 109
Edge 109
Firefox 144
Safari 18
Chrome Android 109
Safari iOS 18

First version with support, from MDN browser-compat-data.

::view-transition-new()

Selector Baseline: newly availablesince October 2025 Modern CSS: View transitions

Spec The ::view-transition-new() pseudo-element (like the analogous ::view-transition-old() pseudo-element) is an empty named view transition pseudo-element that represents a visual snapshot of the “new” state as a replaced element; it is omitted if there’s no “new” state to represent. Each ::view-transition-new() pseudo-element is a child of the corresponding ::view-transition-image-pair() pseudo-element.

MDN The ::view-transition-new() CSS pseudo-element represents the "new" view state of a view transition — a snapshot live representation of the state after the transition.

Browser support

First browser version supporting ::view-transition-new()
Chrome 109
Edge 109
Firefox 144
Safari 18
Chrome Android 109
Safari iOS 18

First version with support, from MDN browser-compat-data.

::view-transition-old()

Selector Baseline: newly availablesince October 2025 Modern CSS: View transitions

Spec The ::view-transition-old() pseudo-element is an empty named view transition pseudo-element that represents a visual snapshot of the “old” state as a replaced element; it is omitted if there’s no “old” state to represent. Each ::view-transition-old() pseudo-element is a child of the corresponding ::view-transition-image-pair() pseudo-element.

MDN The ::view-transition-old() CSS pseudo-element represents the "old" view state of a view transition — a static snapshot of the old view, before the transition.

Browser support

First browser version supporting ::view-transition-old()
Chrome 109
Edge 109
Firefox 144
Safari 18
Chrome Android 109
Safari iOS 18

First version with support, from MDN browser-compat-data.

:active-view-transition

Selector Baseline: newly availablesince January 2026 Modern CSS: Active view transition

Spec The :active-view-transition pseudo-class applies to the root element of the document, if it has an active view transition.

MDN 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.

Live preview Example from MDN
html {
  --bg: indigo;
}
main {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
section {
  background-color: var(--bg);
  height: 60px;
  border-radius: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
}
::view-transition-group(root) {
  animation-duration: 2s;
}

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

Syntax

:active-view-transition

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting :active-view-transition
Chrome 125
Edge 125
Firefox 144
Safari 18
Chrome Android 125
Safari iOS 18

First version with support, from MDN browser-compat-data.

:active-view-transition-type()

Selector Baseline: newly availablesince January 2026 Modern CSS: Active view transition

Spec The :active-view-transition-type() pseudo-class applies to the root element of the document, if it has a matching active view transition. It has the following syntax definition:

MDN The functional :active-view-transition-type() CSS pseudo-class matches elements when a view transition with one or more specific types is in progress (is active) and stops matching once the view transition has completed.

Live preview Example from MDN
html,
body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

div {
  display: flex;
  width: 60%;
  justify-content: space-between;
}

p {
  font-size: 1.7em;
  width: 60%;
  color: blue;
  margin-top: 0;
}

html:active-view-transition {
  :root {
    view-transition-name: none;
  }
  p {
    view-transition-name: slide;
  }
}

html:active-view-transition-type(forwards) {
  &::view-transition-old(slide) {
    animation-name: slide-out-to-left;
  }
  &::view-transition-new(slide) {
    animation-name: slide-in-from-right;
  }
}

html:active-view-transition-type(backwards) {
  &::view-transition-old(slide) {
    animation-name: slide-out-to-right;
  }
  &::view-transition-new(slide) {
    animation-name: slide-in-from-left;
  }
}

@keyframes slide-in-from-left {
  from {
    translate: -100vw 0;
  }
}
@keyframes slide-in-from-right {
  from {
    translate: 100vw 0;
  }
}
@keyframes slide-out-to-left {
  to {
    translate: -100vw 0;
  }
}
@keyframes slide-out-to-right {
  to {
    translate: 100vw 0;
  }
}

Browser support

First browser version supporting :active-view-transition-type()
Chrome 125
Edge 125
Firefox 147
Safari 18.2
Chrome Android 125
Safari iOS 18.2

First version with support, from MDN browser-compat-data.