Render alternative content at a URL when the previous in-app location matches the interceptor's source route.
Intercepting routes render alternative content at a URL when the previous in-app location matches the interceptor's source route. Direct visits and reloads render the real page. The interceptor is a way to show one route inside another without changing the URL.
| Prefix | Intercepts at | Typical use |
|---|---|---|
| (.) | Same level | Modal over a list, photo viewer |
| (..) | One level up | Detail view from a parent page |
| (...) | App root | Modal from anywhere in the app |
Prefix a folder or flat file name with (.), (..), or (...) to make it an interceptor. The folder name is stripped of the prefix and matches the same URL as the target route.
In this tree, src/app/blog/[slug]/page.tsx is the real post page. src/app/blog/(.)[slug]/page.tsx is the interceptor: it matches the same /blog/:slug URL, but only renders when the previous in-app location was /blog.
The interceptor is applied only after a client-side navigation where the previous location matches the interceptor's source route.
| Navigation | What renders |
|---|---|
| Visit /blog/:slug directly | The real [slug] page |
| Reload /blog/:slug | The real [slug] page |
| Navigate from /blog to /blog/:slug | The intercepting (.)[slug] page |
| Navigate from /about to /blog/:slug | The real [slug] page |
If the target URL has no real page, the interceptor's page is registered as the route, and the not-found page is shown for direct visits. This lets you use an interceptor as the only page for a URL that should only ever be reached from another page.
With only the interceptor, /modal renders the modal when navigated to from a rendered page. Visiting /modal directly shows the not-found page.
Data exports (loader, action, shouldRevalidate, ErrorBoundary, HydrateFallback, handle) are not executed in interceptors. The interceptor page is a pure UI layer on top of the real route's data.
loader, put it on the real page, not the interceptor. The interceptor renders the UI; the real page owns the data.A blog where clicking a post from the list opens an interceptor, but loading the post URL directly shows the full page.
| Navigation | What renders |
|---|---|
| Visit /blog/:slug directly | src/app/blog/post/[slug]/page.tsx |
| Reload /blog/:slug | src/app/blog/post/[slug]/page.tsx |
| Click a post from /blog | src/app/blog/(.)post/[slug]/page.tsx |
Render multiple routes in the same layout with named slots.
Match URL segments with dynamic parameters and catch-alls.
Match any number of trailing URL segments.
Define routes with folders and page files inside them.
Navigate between routes with Link, useNavigate, and prefetching.
Create your first pages and wrap them in shared layouts.
Render alternative content at a URL when the previous in-app location matches the interceptor's source route.
Intercepting routes render alternative content at a URL when the previous in-app location matches the interceptor's source route. Direct visits and reloads render the real page. The interceptor is a way to show one route inside another without changing the URL.
| Prefix | Intercepts at | Typical use |
|---|---|---|
| (.) | Same level | Modal over a list, photo viewer |
| (..) | One level up | Detail view from a parent page |
| (...) | App root | Modal from anywhere in the app |
Prefix a folder or flat file name with (.), (..), or (...) to make it an interceptor. The folder name is stripped of the prefix and matches the same URL as the target route.
In this tree, src/app/blog/[slug]/page.tsx is the real post page. src/app/blog/(.)[slug]/page.tsx is the interceptor: it matches the same /blog/:slug URL, but only renders when the previous in-app location was /blog.
The interceptor is applied only after a client-side navigation where the previous location matches the interceptor's source route.
| Navigation | What renders |
|---|---|
| Visit /blog/:slug directly | The real [slug] page |
| Reload /blog/:slug | The real [slug] page |
| Navigate from /blog to /blog/:slug | The intercepting (.)[slug] page |
| Navigate from /about to /blog/:slug | The real [slug] page |
If the target URL has no real page, the interceptor's page is registered as the route, and the not-found page is shown for direct visits. This lets you use an interceptor as the only page for a URL that should only ever be reached from another page.
With only the interceptor, /modal renders the modal when navigated to from a rendered page. Visiting /modal directly shows the not-found page.
Data exports (loader, action, shouldRevalidate, ErrorBoundary, HydrateFallback, handle) are not executed in interceptors. The interceptor page is a pure UI layer on top of the real route's data.
loader, put it on the real page, not the interceptor. The interceptor renders the UI; the real page owns the data.A blog where clicking a post from the list opens an interceptor, but loading the post URL directly shows the full page.
| Navigation | What renders |
|---|---|
| Visit /blog/:slug directly | src/app/blog/post/[slug]/page.tsx |
| Reload /blog/:slug | src/app/blog/post/[slug]/page.tsx |
| Click a post from /blog | src/app/blog/(.)post/[slug]/page.tsx |
Render multiple routes in the same layout with named slots.
Match URL segments with dynamic parameters and catch-alls.
Match any number of trailing URL segments.
Define routes with folders and page files inside them.
Navigate between routes with Link, useNavigate, and prefetching.
Create your first pages and wrap them in shared layouts.