CSS view-transition-name Property
Description
The view-transition-name property lets you mark an element with an identifier that the View Transitions system uses to detect and produce shared-element transitions between two visual states. When a navigation or view change occurs that is wrapped by the View Transitions machinery (for example via the JavaScript API), elements that carry the same computed view-transition-name across the outgoing and incoming views can be matched together so the UA can capture snapshots and animate continuity between them. This makes it possible to produce smooth “move/resize/fade” effects that visually carry an element from one layout to the next rather than having it abruptly disappear and reappear.
Matching is done by comparing the logical name on elements in the two snapshots; the property is used as a key rather than relying on DOM identity or id attributes. Once a match is found, the browser creates transient visual layers (snapshots) for those matched elements and animates differences in geometry, transform, opacity, clipping and other visual characteristics to produce the shared-element effect. Because the implementation works with visual snapshots, layout differences, stacking context, and compositing can affect the result - placing the name on an element that has a stable box and predictable stacking will produce more reliable animations than naming heavily dynamic or reflowing elements.
From a practical perspective, developers use view-transition-name to opt specific elements into view transitions and combine it with other transition/animation techniques. For example, the UA’s snapshot/animation process can interact with normal CSS transitions and animations, so be mindful of how those might overlap; in many cases the browser’s view-transition animation takes precedence for the shared element snapshot while other transitions continue to run on non-matched properties. Also consider interaction with the transient styling hooks the View Transitions spec exposes (such as the pseudo-elements used for the intermediate images) and follow accessibility guidance - provide fallbacks or avoid complex motion when users prefer reduced motion. For typical use, mark a limited set of stable, visually prominent elements (images, avatars, cards) to keep animations performant and predictable; excessive or frequently changing names can lead to heavy snapshotting and jank.
Definition
- Initial value
- none
- Applies to
- all elements
- Inherited
- no
- Computed value
- as specified
- Animatable
- yes
- JavaScript syntax
- object.style.viewTransitionName
Syntax
view-transition-name: none | <custom-ident>;
Values
- noneIndicates that the element should not participate in view transitions.
- <custom-ident>A custom identifier (any valid CSS identifier) that assigns a transition name to the element.
Example
Browser Support
The following information will show you the current browser support for the CSS view-transition-name property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
