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
Person working at a desk with a laptop and books.
View of planet earth from space with clouds.
Orange hallway with stairs leading into a tunnel.
Man holding a sleeping baby on a couch.
Small chapel on a snowy hill under dramatic clouds
Dead trees in a dry desert landscape
Modern living room with fireplace and large windows
Couple shopping for gourds at an outdoor market.
Sunlight streams through a window onto a cafe table.