English for Astro View Transitions
Learn the English vocabulary for discussing Astro's View Transitions API: persisted state, fallback animations, and client-side navigation on static sites.
“The page feels like it reloads” is the exact complaint View Transitions is meant to solve, and being precise about persisted state, fallback behavior, and transition directives helps you explain what’s actually happening when a page still feels like a hard navigation.
Key Vocabulary
View transition — a browser-native animation between two page states during navigation, letting elements shared between the old and new page animate smoothly instead of the page abruptly swapping. “That jarring flash between pages isn’t a bug in our CSS — it’s because the view transition isn’t actually being triggered, so the browser is falling back to a normal hard navigation.”
Persisted state — DOM elements or component state, like a video player or an open dropdown, that survive a page navigation intact instead of being destroyed and recreated, achieved with Astro’s transition:persist directive.
“The music player resets every time you navigate because we haven’t marked it with persisted state — adding transition:persist keeps the same element and its playback state across the page swap.”
Fallback animation — the transition behavior used automatically when the browser doesn’t support native view transitions, ensuring navigation still works and doesn’t look broken, just without the shared-element animation. “We don’t need separate code paths for unsupported browsers — Astro handles that with a fallback animation automatically, so navigation degrades gracefully instead of failing.”
Transition directive — a specific transition:* attribute in Astro, such as transition:name or transition:animate, used to control how an individual element behaves during a view transition.
“Give the hero image a matching transition directive on both pages — right now it has a transition:name on the listing page but not the detail page, so Astro can’t match them up to animate the shared element.”
Client-side navigation — routing between pages without a full page reload from the server, which is what makes view transitions possible at all, since the browser needs to manage both the old and new DOM states during the animation. “This link isn’t animating because it’s triggering a full server reload instead of client-side navigation — check whether it’s opted out of the router, intentionally or by accident.”
Common Phrases
- “Is the view transition actually firing, or is this falling back to a hard navigation?”
- “Does this element need persisted state, or is it fine to reset on navigation?”
- “Are we relying on the fallback animation here, or does this browser support native transitions?”
- “Does this element have a matching transition directive on both pages?”
- “Is this a client-side navigation, or is something forcing a full reload?”
Example Sentences
Debugging a broken transition:
“The shared-element animation isn’t working between these two pages because the transition directive names don’t match — the image has transition:name=\"hero\" on one page but no directive at all on the other, so Astro has nothing to animate between.”
Explaining a state-loss bug:
“Users are losing their place in the video every time they navigate away and back, because the player isn’t using persisted state. Adding transition:persist to that component would keep the same DOM node, and the playback position, across the navigation.”
Describing graceful degradation: “We’re not writing a separate no-JS transition path — older browsers just get the fallback animation automatically, so the site still works everywhere, it just doesn’t get the shared-element effect outside browsers that support it natively.”
Professional Tips
- Say view transition specifically, not just “animation,” when discussing this feature — it distinguishes a native browser-level transition between page states from a CSS animation applied to a single element.
- Use persisted state deliberately, not on every element — persisting things like scroll position or media playback improves the experience, but persisting the wrong element can cause confusing stale-state bugs.
- Confirm the fallback animation is acceptable on its own, not just an afterthought — some users will always see it, so it shouldn’t feel like a broken or degraded experience.
- Check that transition directives match by name across both the old and new page — a mismatched or missing directive is the most common reason a shared-element animation silently doesn’t happen.
Practice Exercise
- Explain what a view transition is and how it differs from a CSS animation.
- Describe when you would use persisted state on an element.
- Write a sentence explaining why a transition directive needs to match across two pages to animate correctly.