Route transition: the headline ball rolls to the clicked link, grows into a tile that covers the page and lands beside the next page's headline.
Click meTap me
Every plan includes unlimited workspaces. Prices exclude VAT and are billed monthly.
€0
Up to 3 people
€24
Per seat, monthly
€60
Per seat, monthly
page-transition, lively
Use it on a product site, docs or a marketing area where moving between pages should feel like one continuous place: every page carries a small ball beside its headline, and on a link click that ball rolls to the link, grows into a tile that covers the viewport, and contracts onto the next page's headline while the new sections rise in. It is router-agnostic: it only needs the current route key and a function that navigates. For in-page panels (tabs, steps) use Tabs or Stepper instead; for a card that opens into a detail view without a route change, use the Morphing Dialog.
pnpm dlx shadcn@latest add @motionkit-pro/page-transitionnpx shadcn@latest add @motionkit-pro/page-transitionyarn dlx shadcn@latest add @motionkit-pro/page-transitionbunx --bun shadcn@latest add @motionkit-pro/page-transitionRequires a Pro license and the @motionkit-pro registry with your token. See Installation.
import {
PageTransition,
PageTransitionAnchor,
PageTransitionView,
TransitionLink,
} from "@/components/ui/page-transition"
export function Site({ pathname }: { pathname: string }) {
return (
<PageTransition routeKey={pathname} onNavigate={(href) => location.assign(href)}>
<header>
<TransitionLink href="/pricing">Pricing</TransitionLink>
<TransitionLink href="/docs">Docs</TransitionLink>
</header>
<PageTransitionView>
<main>
<PageTransitionAnchor>Pricing</PageTransitionAnchor>
<section data-transition-cascade>…</section>
</main>
</PageTransitionView>
</PageTransition>
)
}PageTransition holds the state, draws the cover and announces the new page. Headers and
footers stay inside it, outside the view.PageTransitionView is the part that changes: it is keyed by routeKey, so a new key swaps the
page while the cover is full.TransitionLink is a real <a href> (use asChild for a router link or a card). A plain click
plays the transition and calls onNavigate(href) once the cover is full.PageTransitionAnchor is the page headline (h1 by default) with its ball: where the
transition starts and lands, and where focus goes.data-transition-cascade. For the card preset,
mark the detail page's header tile with data-transition-tile.usePageTransition() returns { phase, navigate(href, { from }) } to start a transition from
code (a form that submits, a command palette).By default the cover is fixed to the viewport. Pass container (an element or a ref, relative)
to draw it inside an embedded app or a preview stage, as the demos on this page do.
temperament (calm, lively, playful) changes only how far and how fast things move: the
ball, the cover and the pages look the same at every temperament. Presets change the configuration:
cover (default, a primary tile wipe), card (the clicked card grows into the page and lands as
the detail page's header tile) and band (the ball stretches into a pill band at the click's height
that thickens into the cover, for text-heavy sites).
Put the wrapper in a client component rendered by the layout (not template.tsx, which
remounts on every navigation and would drop the cover mid-way):
"use client"
import { usePathname, useRouter } from "next/navigation"
import Link from "next/link"
import { PageTransition, PageTransitionView, TransitionLink } from "@/components/ui/page-transition"
export function SiteShell({ children }: { children: React.ReactNode }) {
const pathname = usePathname()
const router = useRouter()
return (
<PageTransition routeKey={pathname} onNavigate={(href) => router.push(href)}>
<header>
<TransitionLink href="/pricing" asChild>
<Link href="/pricing">Pricing</Link>
</TransitionLink>
</header>
<PageTransitionView>{children}</PageTransitionView>
</PageTransition>
)
}<body>
<SiteShell>{children}</SiteShell>
</body>The cover stays full until the new route has rendered and at least holdMin (0.2 s) has passed. A
slow route shows a breathing ball on the cover after holdMax (1.2 s); at twice that the cover
always leaves.
Prop
Type
Also accepts all props of Omit<ComponentProps<"div">, "children">.
Prop
Type
Also accepts all props of ComponentProps<"a">.
Prop
Type
Also accepts all props of ComponentProps<"h1">.
A templates gallery: the clicked card becomes the surface that covers the page, then lands as the detail page's header tile.
Click meTap me
Start a document from a template. Fields stay editable after you create it.
page-transition, lively
The same site with the band preset: the ball stretches into a pill across the page at the
link's height, thickens into the cover and thins back into the ball at the new headline.
Click meTap me
Docs › Guides
A workspace holds your notes, files and people. Create one from the home screen, then invite teammates by email; they join with the role you pick and can change nothing above it.
Notes sync as you type. Each change is kept for the plan's history window, so you can restore any earlier version from the note's menu without asking an admin.
page-transition, lively
target and download keep the browser's behaviour (no transition).aria-hidden and never receives pointer events. While the cover is on screen the
old page is inert.PageTransitionAnchor (tabIndex={-1}, a heading)
and a polite live region says Navigated to {title} (announce changes the text).aria-hidden; it uses primary with two tinted shadows and an inner
highlight, readable on background in both themes.ring-[3px] ring-ring/50; nothing pins scroll.| Key | Action |
|---|---|
| Enter | Follows the link; the ball starts from the link's centre |
| Cmd/Ctrl + Enter or click | Opens the link in a new tab, without a transition |
| Escape | Does nothing: a navigation that started is not cancelable |
No ball travel and no cover: the old page fades out in the short fade time, onNavigate runs, and
the new page fades in with its sections in place. Focus moves to the new headline and the
announcement is made as usual. The headline ball stays as a static mark.
The cover is one layer clipped with clip-path: inset(… round r) (same argument shape every
frame) under a tinted drop-shadow; its geometry is four motion values, so nothing in React
re-renders per frame. Pages only animate transform and opacity. Positions are measured once at
the click and once at the landing, never per frame. Nothing loops except the breathing ball on a
slow route (1.4 s period, removed when the route is ready). Timers and animations are cleaned up
on unmount. Dependencies: motion (peer) and @radix-ui/react-slot (under 1 kB gzip).
Main spring of each temperament. Set it with the temperament prop or MotionKitProvider; the default is lively.
Not measured yet · budget 15.0 kB gzip
Component and MotionKit helpers; excludes react, react-dom, motion, @radix-ui/react-slot.
click, press, an app event
No ball travel and no cover: the old page fades out and the new page fades in; focus moves to the new headline and the change is announced as usual.
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)