Welcome to Vanilla Breeze
This bell pulls live notifications from /go/notify/messages — the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
This bell pulls live notifications from /go/notify/messages — the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
CSS-only page transition effects with named groups, shared element morphing, animation presets, and a declarative init script.
Import the opt-in CSS utility. This single import gives you smooth crossfade transitions on all same-origin navigations:
@import "vanilla-breeze/utils/view-transitions.css";
That’s it for basic crossfade. The <main> element automatically gets a named transition group (main-content) so content fades smoothly between pages.
For shared element morphing, add data-vt-name to elements that should animate between pages:
<!-- Gallery page --><a href="/products/123"> <img data-vt-name="product-123" src="thumb.jpg" /> <h2 data-vt-name="title-123">Product Name</h2></a> <!-- Detail page - matching names morph smoothly --><img data-vt-name="product-123" src="hero.jpg" /><h1 data-vt-name="title-123">Product Name</h1>
The data-vt-name attribute requires the init script (included in all doc site layouts, or import view-transition-init.js).
Use data-vt to assign common transition names to page regions. Named elements persist or morph across navigations instead of crossfading.
| Attribute | Transition Name | Use Case |
|---|---|---|
data-vt="main" | main-content | Main content area (auto-applied to <main>) |
data-vt="header" | page-header | Site header — persists across pages |
data-vt="nav" | site-nav | Primary navigation |
data-vt="sidebar" | page-sidebar | Sidebar navigation — stays in place within sections |
data-vt="hero" | page-hero | Hero image or banner |
data-vt="footer" | site-footer | Site footer |
<header data-vt="header">...</header><nav data-vt="sidebar">...</nav><main> <!-- auto-named as main-content --> <div data-vt="hero">...</div> ...</main><footer data-vt="footer">...</footer>
When navigating between pages with the same named group, the browser morphs the element in place rather than crossfading. This keeps headers, sidebars, and footers visually stable during navigation.
Custom properties control transition duration:
| Token | Default | Use Case |
|---|---|---|
--view-transition-duration | 0.3s | Standard transitions |
--view-transition-duration-fast | 0.15s | Subtle, quick transitions |
--view-transition-duration-slow | 0.5s | Dramatic, deliberate transitions |
:root { /* Slow down all transitions */ --view-transition-duration: 0.5s;}
Interactive examples showing view transitions in action. Open in a new tab for the full MPA navigation experience.
Card grid with shared element morphing to detail pages.
Vertical list with title and thumbnail morphing to a detail view.
Header and sidebar stay in place while main content transitions.
Side-by-side comparison of slide, scale, fade, and none presets.
For traditional multi-page sites, use the CSS @view-transition rule. This is what the Vanilla Breeze utility provides:
@view-transition { navigation: auto;}
The browser automatically triggers transitions on same-origin navigations. No JavaScript needed.
For SPA routing (client-side navigation), use the JavaScript API:
document.startViewTransition(() => { // Update the DOM here updateContent(newContent);});
The same CSS transition names and animation presets work with both approaches.
| Browser | Same-document | Cross-document (MPA) |
|---|---|---|
| Chrome / Edge | 111+ | 126+ |
| Safari | 18+ | 18+ |
| Firefox | Pending | Pending |
In unsupported browsers, pages load normally without transitions. No errors, no broken functionality — true progressive enhancement.
prefers-reduced-motion: reduce is active (animation duration set to 0.01ms)view-transition-name must be unique. Duplicate names on the same page cause the transition to fail silently.