Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. ViewTransitionTypeSet

ViewTransitionTypeSet

Baseline 2026
Newly available

Since January 2026, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

TheViewTransitionTypeSet interface of theView Transition API is aset-like object representing the types of an active view transition. This enables the types to be queried or modified on-the-fly during a transition.

TheViewTransitionTypeSet object can be accessed via theViewTransition.types property.

The property and method links below link to the JavaScriptSet object documentation.

Instance properties

Set.prototype.size

Returns the number of values in the set.

Instance methods

Set.prototype.add

Inserts the specified value into this set, if it is not already present.

Set.prototype.clear()

Removes all values form the set.

Set.prototype.delete()

Removes the specified value from this set, if it is in the set.

Set.prototype.entries()

Returns a new iterator object that containsan array of[value, value] for each element in the set, in insertion order.

Set.prototype.forEach()

Calls a callback function once for each value present in the set, in insertion order.

Set.prototype.has()

Returns a boolean indicating whether the specified value exists in the set.

Set.prototype.keys()

An alias forSet.prototype.values().

Set.prototype.values()

Returns a new iterator object that yields thevalues for each element in the set, in insertion order.

Set.prototype[Symbol.iterator]()

Returns a new iterator object that yields thevalues for each element in the set, in insertion order.

Examples

js
// Start a view transitionconst vt = document.startViewTransition({  update: updateTheDOMSomehow,  types: ["slideLeft", "fadeOut", "flipVertical"],});// Add another typevt.types.add("flipHorizontal");// Delete a typevt.types.delete("flipVertical");// Return the number of types in the setconsole.log(vt.types.size);// Log each type to the consolevt.types.forEach((type) => console.log(type));

Specifications

Specification
CSS View Transitions Module Level 2
# viewtransitiontypeset

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp