Conversation
crisbeto
reviewed
Sep 29, 2026
crisbeto
left a comment
Member
There was a problem hiding this comment.
Looks like there's a lint error.
MeAkib
force-pushed
the
docs/router-view-transitions
branch
from
September 29, 2026 15:41
65f0601 to
d74a9b6
Compare
Navigating between pages in the docs app swapped the content instantly.
This enables the router's `withViewTransitions()`, so browsers that
support the View Transitions API cross-fade from the old page to the new
one. Other browsers keep the current behavior.
Changes:
- Add `withViewTransitions({skipInitialTransition: true})` to the router
config. The first page load isn't animated, since there's no previous
page to transition from.
- Add a global `prefers-reduced-motion: reduce` rule that disables the
view transition animations, so those users get an instant page swap.
Checked in Chrome against the dev server, comparing against a run with
`document.startViewTransition` removed to get the behavior without
transitions:
- Clicking a category card runs a 250ms cross-fade of the root.
- The first page load doesn't start a transition.
- Focus still moves to the new page's `focusOnNavigation` target.
- Navigating to another page with a `#fragment` still scrolls the target
heading into view, at the same position as without transitions.
- With reduced motion, the transition starts but runs no animations.
MeAkib
force-pushed
the
docs/router-view-transitions
branch
from
September 29, 2026 15:47
d74a9b6 to
afde0da
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Navigating between pages in the docs app swapped the content instantly. This enables the router's
withViewTransitions(), so browsers that support the View Transitions API cross-fade from the old page to the new one. Other browsers keep the current behavior.Changes:
withViewTransitions({skipInitialTransition: true})to the router config. The first page load isn't animated, since there's no previous page to transition from.prefers-reduced-motion: reducerule that disables the view transition animations, so those users get an instant page swap.Checked in Chrome against the dev server, comparing against a run with
document.startViewTransitionremoved to get the behavior without transitions:focusOnNavigationtarget.#fragmentstill scrolls the target heading into view, at the same position as without transitions.