Documentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/dev-nexus/llms.txt
Use this file to discover all available pages before exploring further.
PageTransition is a lightweight Framer Motion wrapper component used by every page in Dev Nexus to produce consistent enter and exit animations during client-side navigation. It accepts a single children prop and renders a motion.div that blurs and scales into view when a page mounts and blurs and scales out of view when it unmounts, driven by React Router v6 route changes and Framer Motion’s AnimatePresence.
Props
The full JSX content of the page being wrapped. Every page component in Dev Nexus passes its top-level JSX as children to
PageTransition.Animation Values
Themotion.div is configured with the following fixed animation variants:
| Prop | Value | Effect |
|---|---|---|
initial | { opacity: 0, scale: 0.95, filter: 'blur(10px)' } | Page starts invisible, slightly shrunk, and blurred |
animate | { opacity: 1, scale: 1, filter: 'blur(0px)' } | Page fades in, expands to full size, and sharpens into focus |
exit | { opacity: 0, scale: 1.05, filter: 'blur(10px)' } | Page fades out while expanding slightly and blurring |
transition.duration | 0.5 | All phases complete in 500 ms |
transition.ease | 'easeInOut' | Smooth acceleration and deceleration on both ends |
min-h-screen pt-24 pb-12 px-4 sm:px-6 lg:px-8 relative z-10.
Usage
Wrapping a page component
Every page component in Dev Nexus follows this pattern:Enabling exit animations with AnimatePresence
PageTransition only produces exit animations when it is a direct child of Framer Motion’s AnimatePresence. Wrap your route outlet with AnimatePresence in your application shell:
The
key={location.pathname} on <Routes> is essential — it forces React to treat each route as a distinct component instance, which triggers the exit animation on the outgoing page before the incoming page mounts. Without it, exit animations will not fire.How It Works
PageTransition is intentionally minimal:
className also provides each page with standard vertical padding (pt-24 pb-12), responsive horizontal padding, a minimum full-screen height, and a z-10 stacking context above the ParticleField canvas.
Customization Tips
Change animation duration: Adjusttransition.duration from 0.5 to a lower value (e.g., 0.3) for snappier transitions or higher (e.g., 0.8) for a more cinematic feel.
Use a different easing curve:
Replace the ease property in the transition object:
scale + filter approach for a vertical slide:
useReducedMotion hook to skip animations for users who prefer reduced motion: