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
Woman working at desk with coffee
Horizontal gradient from purple to yellow and orange.
A green bug sitting on top of a green leaf
Silhouette of a person in a field at sunset.
Keyboard and stool in a sunlit room
Person exiting a 99¢ store with a bag.
Castle in a valley framed by trees with mountains behind.
Person using a smartphone over a notebook
People stand outside a small "tartes" bakery.