New Apr 2, 2026

Introducing view-transitions-toolkit, a collection of utility functions to more easily work with View Transitions.

More Front-end Bloggers All from Bram.us View Introducing view-transitions-toolkit, a collection of utility functions to more easily work with View Transitions. on bram.us

Screenshot of the View Transitions Toolkit homepage

~

In my work with View Transitions over the last several years, I’ve published everything from deep-dive articles, demos, and announcement videos at Google I/O. I’ve also done some more experimental things with it, such as optimizing the keyframes or driving a View Transition by scroll.

To turn the lessons from these scattered experiments into something more reusable for both you and me, I’ve bundled the most frequent code patterns into a dedicated package: view-transitions-toolkit.

~

The view-transitions-toolkit

view-transitions-toolkit is a collection of small, focused helper functions for use with View Transitions. They fill in some of the gaps to making advanced patterns much easier to implement.

The goal of the project is to provide these utilities so you don’t have to reinvent the wheel every time you want to do something slightly advanced with View Transitions.

~

Getting Started

Using the toolkit is incredibly simple. First, install it from npm:

npm i view-transitions-toolkit

Then, you can import the modules you need and use their functions. Optimizing the keyframes of a View Transition group for example is a simple one-liner:

import { optimizeGroupAnimations, OPTIMIZATION_STRATEGY } from "view-transitions-toolkit/animations";

const t = document.startViewTransition(() => { … }); await t.ready;

// Optimize all Group Animations using the default SCALE strategy optimizeGroupAnimations(t, "*");

// Optimize only the ::view-transition-group(box-flip) animation using the SLIDE strategy optimizeGroupAnimations(t, "box-flip", OPTIMIZATION_STRATEGY.SLIDE);

I won’t go into details here, as all features are documented in the docs folder of the repo.

~

Demos

The project also comes with a public website that not only gives you the basic info, but also comes with a bunch of demos: https://chrome.dev/view-transitions-toolkit/.

Screenshot of the optimize() demo

The source of the demos is included in the repository as well.

~

Go check it out

~

Spread the word

Feel free to reshare one of the following posts on social media to help spread the word:

Scroll to top