Skip to main content
Native API

View Transitions

Smooth page transitions using the native View Transitions API โ€” no client-side router needed.

How It Works

Astro integrates the browser's native View Transitions API. When you navigate between pages, the browser smoothly animates the transition โ€” no JavaScript router required.

Page-Level Transitions

Click any link below. Notice the smooth crossfade between pages:

Element-Level Morph

When two pages share an element with the same transition:name, the browser morphs one into the other. Try it:

Go to Blog โ†’ Click an article to see title morph

Technical Details

Setup

Add <ViewTransitions /> to your layout's <head>. That's it โ€” all pages get crossfade transitions.

Element Morph

Add matching transition:name="my-element" on both source and target pages. The browser handles the animation.

Persist State

Add transition:persist to keep island state (like a counter value) across navigations.

Browser Support

Chrome, Edge, Opera. Falls back to standard navigation in Firefox/Safari โ€” progressive enhancement.