view-transition-class
The view-transition-class CSS property sets a name that can be used to apply styles to multiple named view transition pseudo-elements.
Overview
The view-transition-class CSS property sets a name that can be used to apply styles to multiple named view transition pseudo-elements.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 125 | 125 | 144 | 18.2 | 125 | 18.2 | |
none | 125 | 125 | 144 | 18.2 | 125 | 18.2 |
1+Supported (version) Not supported ※Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Syntax
CSS
.card {
view-transition-class: card-transition;
}
::view-transition-group(*.card-transition) {
animation-duration: 0.3s;
} Live demo
Use cases
State transitions
Use view-transition-class to clarify UI changes such as opening, reordering, or page transitions.
Polished feedback
Add motion only where it reinforces direction, hierarchy, or system response.
Cautions
- Motion features can quickly become distracting if they are applied too broadly.
- Keep animation rules paired with sensible non-animated fallbacks.
Accessibility
- Respect reduced-motion preferences and keep essential information available without animation.
- Motion should support understanding, not become a barrier to interaction.
Related links
Powered by web-features