Skip to main content
v2.2.13+ Inertia supports the View Transitions API, allowing you to animate page transitions. The View Transitions API is a relatively new browser feature. Inertia gracefully falls back to standard page transitions in browsers that don’t support the API.

Enabling Transitions

You may enable view transitions for a visit by setting the viewTransition option to true. By default, this will apply a cross-fade transition between pages.

Transition Callbacks

You may also pass a callback to the viewTransition option, which will receive the standard ViewTransition instance provided by the browser. This allows you to hook into the various promises provided by the API.
The viewTransition option is also available on the Link component.
You may also pass a callback to access the ViewTransition instance.

Global Configuration

You may enable view transitions globally for all visits by configuring the visitOptions callback when initializing your Inertia app.

Customizing Transitions

You may customize the transition animations using CSS. The View Transitions API uses several pseudo-elements that you can target with CSS to create custom animations. The following examples are taken from the Chrome documentation .
You may also animate individual elements between pages by assigning them a unique view-transition-name. For example, you may animate an avatar from a large size on a profile page to a small size on a dashboard.
You may customize view transitions to your liking using any CSS animations you wish. For more information, please consult the View Transitions API documentation .