Astro Islands & SSR (50 Qs)•Part 2: Core Architecture & Implementation (Mid-Level)
What is the Astro View Transitions API (`<ViewTransitions />`)?
senior LevelCode ExampleSystem DesignAstroHTTP & REST APIs
In Simple Words: Multi-Page Applications (MPAs) traditionally suffered from a white flash during full-page reloads. Astro incorporates the native browser View Transitions API:
astro
---
import { ViewTransitions } from 'astro:transitions';
---
<head>
<ViewTransitions />
</head>
- Automatically intercepts link clicks, fetches the next page HTML via
fetch(), and morphs the DOM with smooth cross-fade or slide animations. - Eliminates the need for heavy client-side routers (React Router).