
Block Transition
Transitions
A layered route transition that shifts pages with offset, rotation and scale, giving portfolios and brand sites a spatial handoff without a full 3D scene.
Depth Shift Transition moves the route change through a layered shift in offset, rotation and scale instead of a flat cut.
It gives navigation a sense of space: the current page pulls back, moves aside and makes room while the next view arrives with depth. Use it when a site wants route changes to feel dimensional but does not need a full WebGL scene.
Use Depth Shift Transition on portfolios, agency sites, editorial journeys, brand microsites, and launch pages where navigation can carry a controlled visual moment. The page job is continuity: the visitor should feel the change of route, understand the destination, and keep moving without waiting for the animation to finish performing.
The production risk is disorientation. Perspective motion can feel premium when it is short and clear, but it becomes frustrating when it hides the destination, breaks scroll restoration, or leaves keyboard focus behind on the previous route.
import DepthShiftTransition from "@/components/effects/depth-shift-transition";import React from "react"; export default function layout({ children }: { children: React.ReactNode }) { return ( <DepthShiftTransition> {children} </DepthShiftTransition> );}A creative portfolio can use Depth Shift Transition between project pages so each case study feels connected to the next. The old page recedes, the new page arrives, and the visitor lands in the destination content without losing orientation. The outcome is spatial continuity: navigation feels designed without becoming a loading screen.
Not for dashboards, docs, checkout, search, pricing comparison flows, or routes where navigation speed is the feature.
Not for pages where perspective movement would make users lose their place.
Keep the transition short, animate transform and opacity, avoid layout reads during route change, and clean up listeners or timelines after navigation completes. Depth should come from composited layers, not from expensive layout work.
Move focus to the destination main region or heading after navigation. On mobile, reduce perspective distance and avoid heavy motion that makes the route feel unstable. Reduced-motion users should get instant navigation or a brief fade.
| Prop | Type | Default | Description |
|---|---|---|---|
bgColor | string | #0b0b0c | Background color behind the transitioning pages. |
duration | number | 0.65 | Duration of the exit phase. Enter timing scales with this value. |
exitOffsetX | number | 20 | Horizontal offset applied to the outgoing page during desktop transitions. |
exitOffsetY | number | 30 | Vertical offset applied to the outgoing page during desktop transitions. |
exitRotate | number | 3 | Rotation applied to the outgoing page as it recedes. |
Use it when a brand, portfolio, or campaign site needs route changes to feel dimensional without using a heavy 3D scene.
Mount it in your root layout around {children}, as in the usage code. Depth Shift Transition renders TransitionRouter from next-transition-router itself, so it stays mounted across navigations and no separate provider or template is needed.
By default the old page shifts away over 0.65s while the new one arrives after a 0.35s delay over 0.4s, so the swap completes in about 0.75s. The duration prop (default 0.65) scales all three values.
Focus should move to the destination main region or heading once navigation completes. Keyboard users should not remain anchored to the old route.
With reduced motion enabled, the component skips the depth shift and runs a 0.2s opacity fade instead.
Yes. A custom version should define depth distance, timing, layer behavior, App Router integration, focus restoration, mobile fallback, reduced-motion handling, source handoff, and implementation notes.
Need a custom effect? Tell us what to create.