Animated transitions between pages, built on view transitions, for Next.js, React Router and TanStack Router.
Home
Animated primitives for Radix UI, Base UI and React Aria.
Effects

fadeA crossfade through a light blur.
slideSlides in 60px and fades, towards where you go.
pushThe new page pushes the old one out.
zoomThe old page grows away, the new one settles in.
irisOpens as a circle from where you clicked.
wipeA clean edge reveals the new page.
bandsFive staggered bands reveal the new page.
stackLands on the old page, which sinks back.
flowA quick slide through a strong motion blur.
chopA diagonal cut reveals the new page.random picks another of these effects at each navigation, the same for the page that leaves and the one that arrives.
Installation
It needs React 19.3 or later, and plays in browsers with view transitions (Chromium 125+, recent Safari and Firefox). Elsewhere, pages change without animation.
Usage
Wrap the content that changes from one page to the next, in the layout, so the header and navigation around it stay still:
One effect per navigation
A transition type named after an effect plays it for that navigation, whatever effect says. Tabs that switch between views of the same page can push sideways while the rest of the site stacks:
<Link href="/pricing/yearly" transitionTypes={['push', 'nav-forward']}>
Yearly
</Link>With TanStack Router, pass them in viewTransition={{ types: ['push', 'nav-forward'] }}; with React Router, call addTransitionType('push') in the transition.
Shared elements
An element on both pages, like a card that becomes a page header, morphs from one to the other with PageTransitionShared. Give it the same name on both pages, unique on each page:
<PageTransitionShared
name={`cover-${post.id}`}
className="h-20 rounded-lg bg-primary"
/>Animation
- Each page is a snapshot the browser animates: the old page plays its exit and the new one its entrance, on Animate UI's curves (
ease.outto arrive, a quickerease.leaveto go). Both stay inside the page's box. - Direction comes from the
nav-backandnav-forwardtransition types: a navigation without one plays forward. - View transitions aren't interruptible: a click during one waits for it to end, so the effects stay short (0.3s to 0.7s).
- The browser's back button doesn't animate with Next.js and React Router (React renders history navigations at once). TanStack Router animates it, forward.
- Under reduced motion, every effect becomes the crossfade, blur included.
API Reference
PageTransition
| Prop | Type | Default |
|---|---|---|
effect? | 'fade' | 'slide' | 'push' | 'zoom' | 'iris' | 'wipe' | 'bands' | 'stack' | 'flow' | 'chop' | 'random' | 'fade' |
pageKey? | React.Key | the pathname |
PageTransitionShared
| Prop | Type | Default |
|---|---|---|
name | string | - |









