view-transitions-mock is a non-visual polyfill for the Same-Document View Transitions API, created to eliminate the need for defensive browser-support checks in your code. It implements the full JavaScript API surface of the View Transition spec (including ViewTransition promises, transitionRoot, activeViewTransition, and View Transition Types) without polyfilling the visual/animation aspects. Install via npm, call register() before using document.startViewTransition(), and your code runs without errors in all browsers. Registration can be tuned with requireTypes and forced options for fine-grained control.

4m read timeFrom bram.us
Post cover image
Table of contents
The Challenge: Writing Future-Proof CodeThe Solution: view-transitions-mockGetting StartedTweaking the registrationSee it in Action
1 Comment

Sort: