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
A close up view of a white wall
A group of people riding horses down a street
Woman stands on beach reflecting at sunset.
A tree silhouetted against a sunset sky.
A stylish motel and palm trees on a sunny day.
Man poses with camel and pyramids in egypt.
White fabric flows in a graceful, abstract way.
Notebook, pen, headphones, and coffee on a wooden desk.
A bulldog sits comfortably on a white couch.