View Transitions
Crax includes a useViewTransition hook that wraps navigations in the browser's native View Transitions API. On browsers that do not support it, the fallback is a plain callback with no transition.
Basic usage
On the Link component
Pass the viewTransition prop to any Link to wrap that navigation automatically:
viewTransition is automatically disabled when the user's OS has prefers-reduced-motion: reduce set, regardless of the prop value — no extra check needed on your end.
Checking support
Custom transition styles
Add CSS in src/index.css to control the animation. The default template includes a simple fade:
Override with any CSS animation targeting ::view-transition-old(root) and ::view-transition-new(root), or target named elements with view-transition-name for element-level transitions.
