Next.js Intercepting Routes Modal example

An example showing Next.js 13's Intercepting Routes feature.

Navigating into the photo page client-side will open a modal instead of a full page, while still updating the URL. Navigating directly into the photo page URL or refreshing the page while the modal is open will bring up the photo page instead.

View Source
Barn silhouetted against a sunrise sky
A wooden fence in the foreground overlooking a dark lake and snow-capped mountains at golden hour
A soft abstract gradient shifting from pale blue to pink and yellow
A neon sign reading "MUSICAL Memories" in a dark shop window at night
A long exposure of a skyscraper illuminated against a black night sky in Guangzhou
A person with dark hair and glasses behind a large gold letter W overlay
A small cabin with a glowing window in a snowy forest at night
Aerial view of the Brisbane River, Victoria Bridge, and South Bank at dusk
Abstract blue shapes separated by dark branching cracks on a textured surface