Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/vtbag/website. The @vtbag website. ⭐️ Please star to support this work! ⭐️
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384---title: API Levels and Implicationsdescription: What are those levels of the View Transition API, and what does that mean for me as a dev? head: - tag: meta attrs: property: "og:image" content: "/bag-og.png"---The (preliminary) View Transition API's specification comes in two parts:
* Level 1: *CSS View Transitions Module Level 1* (Editor's Draft) [https://drafts.csswg.org/css-view-transitions-1/](https://drafts.csswg.org/css-view-transitions-1/)
* Level 2: *CSS View Transitions Module Level 2* (Editor's Draft) [https://drafts.csswg.org/css-view-transitions-2/](https://drafts.csswg.org/css-view-transitions-2/)
Nowadays, the Level 1 document is frozen, while the Level 2 document is still in development.
Splitting the specification into two parts allowed browser vendors to roll out the API incrementally.
You might often hear that * Level 1 is _same-document_ view transitions and * Level 2 defines _cross-document_ view transitions
It is a neat, memorable way to explain it. Half-true, slightly wrong, but sticky enough to spread. Just do not forget: the real implications still hide in the details.
I prefer to think of Level 1 as the core and Level 2 as the extensions.
## Level 1: Core Features
The essentials boil down to these core features:* The [`view-transition-name`](/basics/pseudos/#view-transition-names) CSS property to mark elements that should participate in the view transition. * The [`document.startViewTransition()`](/basics/javascript/#startviewtransition) function that takes an update callback and returns a `ViewTransition` object with three promises (`updateCallbackDon`, `ready`, `finished`) and the `skipTransition()` function. * [Pseudo-elements](/basics/pseudos/#types-of-pseudo-elements) and selectors to capture, structure and style before and after images: `::view-transition`, `::view-transition-group`, `::view-transition-image-pair`, `::view-transition-old` and `::view-transition-new` * Additions to the user [agent stylesheet and dynamically generated animations](/basics/styling/#the-user-agent-stylesheet).* Some rules when view transitions automatically get skipped, e.g. on resize events or view transition start while another view transition is still active.
## Level 2: ExtensionsPart two indeed adds extensions for cross-document view transitions, but also features that come extremely handy for same-document, even though they are no core features.
### Cross-Document* The `@view-transition{ navigation: auto }` at-rule to opt in to [cross-document view transitions](/basics/javascript/#cross-document-view-transitions). * `pageswap` and `pagereveal` [events](/basics/javascript/#pageswap-and-pagereveal-events) that give access to the view transition object on the old and new page.* An [`activation`](/basics/javascript/#activation-object) property on `pageswap` holds a `NavigationActivation` object from the Navigation API. There are no equivalent properties on `pagereveal`. Use `navigation.activation` from the Navigation API instead.
### Extensions for Both, Same- and Cross-Document * The [`view-transition-class`](/basics/styling/#with-classes) property and selector syntax to address multiple pseudo-elements with a single selector.* [View transition types](/basics/styling/#with-types) being part of the ViewTransition object, the `startViewTransition()` signature, and the `@view-transition{ }` at-rule; as well as matching pseudo-class selector `:active-view-transition-type()` and the type-less `:active-view-transition`.* [Generated view transition names](/basics/pseudos/#auto-generated-names-match-element) with `view-transition-name: auto` and `view-transition-name: match-element`.* [Nested view transition groups](/basics/pseudos/#nested-view-transition-groups) with the `::view-transition-group-children()` pseudo element.
## Upcoming extensions
* [Scoped view transitions](/basics/javascript/#scoped-view-transitions)
## Implications
The new features defined in Level 2 of the view transition API are in deed written as extensions to the Level 1 spec. They can easily be merged into one specification. But the interesting part here is not the document structure but the implication from incremental releasing of the two parts.
Up to now, all vendors have implemented and released Level 1 first before they went on to Level 2. For Chrome and Edge there was a period of over 12 month before Level 2 got released. For Safari, it had been 3 month. Firefox released Level 1 of the API last year, as it was part of Interop 2025. It's unclear when Level 2 will be released.
For the Chromium based browsers, this was not a problem as when they released Level 1 support there where no other browsers that understood Level 2. When Safari came out, this was different, but it did not take that lon for them to deliver Level 2 after that.
### Same-Document Features Missing in Level 1The problem is not same-document vs. cross-document. The problem is that there are Safari and Chrome browser versions out there in the wild that support only Level 1 of the API. To say it more clearly: Soon you can use same-document view transitions on all major browsers, but if you want to support them all, you can't use the extensions from the Level 2 list above.
This might be obvious for the more experimental stuff like nested view transition groups or scoped view transitions.
But for simple same-document view transitions, there are some highly desirable features that we cannot use cross-browser before Level 2 becomes baseline.- no support for the option parameter when calling `document.startViewTransition()`- no view transition classes- no view transition types and their pseudo-classes- no auto-generated view transition names with match-element (or auto)
### What Happens when Firefox Releases Level 1
Firefox , starting with v144, not only supports Level 1 of the View Transition API, but also brings some Level 2 features:* Firefox already [has support for `view-transition-class`](https://bsky.app/profile/vtbag.dev/post/3ltwvggp7xc2u) and the [`:active-view-transition` pseudo-class](/basics/test-page/).* Firefox already [has support for `view-transition-name: match-element`](https://bsky.app/profile/martr.app/post/3lwyzve7nac2i), but not for `view-transition-name: auto`, which is not really part of the standard. When usings the [declarative-names script](/tools/utensil-drawer/#declarative-names) from The Bag's Utensil Drawer, you also have an alternative for dynamically generating view transition names that works more reliably across browsers.* In the meanwhile, Firefox also supports `:active-view-transition-type()`.* So the main problem might be the missing support for view transition types in older versions. Good news here: The Bag's Utensil Drawer now has a [polyfill for view transition types](/tools/utensil-drawer/#usetypespolyfill-always--auto--never) to support them even on browsers that only implement Level 1 of the View Transition API!* And even if you do not care about types yet, you can still benefit from the fact that [mayStartViewTransition](/tools/utensil-drawer/#maystartviewtransition) also offers the Level 2 signature with options, even if the underlying API implementation does not.