// Start a view transition
const vt = document.startViewTransition({
update: updateTheDOMSomehow,
types: ["slideLeft", "fadeOut", "flipVertical"],
});
// Add another type
vt.types.add("flipHorizontal");
// Delete a type
vt.types.delete("flipVertical");
// Return the number of types in the set
console.log(vt.types.size);
// Log each type to the console
vt.types.forEach((type) => console.log(type));ViewTransitionTypeSet / notebook
ViewTransitionTypeSet
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.