View Transitions
Wrap page content with with_view_transition for per-route boundaries. NavLink SPA navigation uses the View Transitions API automatically.
View transitions
Click navigate — every NavLink on this site uses Resuma SPA navigation with the View Transitions API.
Docs site wiring
This documentation app wraps layout Slot content in with_view_transition(path_slug, …) and styles ::view-transition-old/new(root) in site CSS — try the sidebar or the demo above.
Page wrapper
pub fn page(_req: FlowRequest) -> View {
with_view_transition(
"home",
vec![Child::View(view! {
<article class="page">
<h1>"Home"</h1>
<p>"Content animates on navigation."</p>
</article>
})],
)
}Unique transition names
Use a distinct name per route (e.g. home, about) so the browser can cross-fade between pages.
CSS
::view-transition-old(root) {
animation: fade-out 200ms ease;
}
::view-transition-new(root) {
animation: fade-in 200ms ease;
}Skip when a popover is open
Chromium skips the View Transition update callback if a :popover-open or dialog[open] is on the page. Resuma therefore skips VT in that case, and also on soft invalidate / loader_poll (no full-page flash every tick). Do not wrap html[data-theme] swaps in startViewTransition — see Theme.
Fallback
Browsers without View Transitions support render content normally — no polyfill required.