page-transitions

Implement a three-layer Framer Motion overlay for Next.js App Router route changes.

Updated Nov 18, 2025
One-click install
npx skills add https://github.com/deomiarn/website-template --skill page-transitions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: page-transitions
Source: https://github.com/deomiarn/website-template/tree/main/.claude/skills/page-transitions
Command: npx skills add https://github.com/deomiarn/website-template --skill page-transitions

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Provides a visually polished, non-intrusive page transition that covers the screen during navigation and reveals only when the new page is ready, reducing perceived load.

Core Features & Use Cases

  • 3-Layer Overlay: Staggered color layers cover the screen on navigation.
  • Wait for Load: Overlay remains until the new page is fully loaded.
  • Accessibility: Respect reduced motion preferences and avoid blocking interactions.

Quick Start

Implement the PageTransition component in the locale layout and ensure transitions fire on route changes.

Frequently Asked Questions about page-transitions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce navigation jank in Next.js with page transitions?

Page transitions mask loading delays by displaying a fullscreen overlay during route changes. A three-layer animated overlay covers the screen when navigation starts, stays visible until the new page fully loads, then reveals the content—eliminating perceived lag and improving perceived performance.

Can I use Framer Motion for smooth page transitions in Next.js App Router?

Yes. Framer Motion enables staggered animations on fixed overlay layers that trigger on pathname changes. The component detects route shifts, animates the layers with scaleX transforms, waits for page load completion, then animates out to reveal the new content.

How do I implement page transitions that respect accessibility preferences?

Page transitions must honor reduced-motion media queries to comply with accessibility standards. The overlay component should detect prefers-reduced-motion and skip animations or use instant transitions when enabled, ensuring users who need motion reduction aren't forced into jarring effects.

What's the best way to prevent page transitions from blocking user interactions?

Fixed overlay elements must not interfere with pointer events or form inputs during transitions. Using pointer-events: none on inactive layers or timing the overlay reveal to match actual page readiness ensures users can interact once content appears.

Do page transition overlays work with locale-based routing in Next.js?

Yes. The transition overlay integrates into locale layouts in Next.js App Router, triggering whenever the pathname changes—including locale switches. The three-layer overlay fires consistently across all route transitions within the layout wrapper.

What happens if the new page takes a long time to load during a transition?

The overlay remains visible until the page fully renders, maintaining the visual bridge between states. Once load completion is detected, the overlay animates away. For extended delays, the overlay prevents showing incomplete or flickering content to users.