startViewTransition

fun startViewTransition(callbackOptions: ViewTransitionUpdateCallback = definedExternally): ViewTransition(source)

The startViewTransition() method of the Document interface starts a new same-document (SPA) view transition and returns a ViewTransition object to represent it.

MDN Reference