PageTransition
Animates between pages or views.
Animatedimport { PageTransition } from 'umbra-ui/motion'
Props
| Prop | Type | Default | Description |
|---|---|---|---|
transitionKey required | string | number | — | Changes when the page changes, e.g. the pathname. A new key plays the exit, then the enter. |
mode | "wait" | "sync" | wait | `wait` finishes the exit before entering; `sync` overlaps them. |
reducedMotion | "system" | "always" | "never" | "system" | Reduced-motion override. Under reduced motion every variant becomes a plain fade. |
variant | "scale" | "fade" | "slide" | slide | Movement style. |
Usage notes
Key it by route. In the Next.js App Router, use it in a template.tsx.
Accessibility
- Does not manage focus: move focus to the new page's heading yourself on navigation.
- Under reduced motion every variant becomes a fade.
Import
import { PageTransition } from 'umbra-ui/motion';
import 'umbra-ui/styles.css'; // once, at the root of your app