DocsPluginsShowcaseReleases
npmStar us on GitHub

Getting Started

IntroductionInstallationProject StructureLayouts and PagesLinking and Navigating

Routing

Folder-Based RoutingFile-Based RoutingDynamic RoutesParallel RoutesIntercepting RoutesCatch-All RoutesMDX & Markdown Pages

Special Files

Loading UIError BoundariesTemplateDefaultNot Found

Data Fetching

LoadersActionsAccessing Route Data

Metadata

Metadata & SEOOpen Graph & TwitterIcons & Favicons

API Routes

API Routes OverviewPlain Function HandlersHono IntegrationDynamic API Routes

Environment Variables

OverviewPrefixes & Client ExposureUsing in API Routes

Styling

CSS OverviewTailwind CSSCSS Modules

Platforms

WebWindowsmacOSLinuxAndroidiOS

Deployment

Deployment OverviewProduction ServerStatic ExportHosting Providers

A native React framework for building cross-platform applications from a single codebase.

Resources

  • Documentation
  • Plugins
  • Showcase
  • Releases

Community

  • GitHub Discussions
  • Reddit
  • Discord
  • LinkedIn

More

  • npm
  • GitHub
  • Issues
  • License

© 2026 Bini Cooperation.

Intercepting Routes

Experimental

Render alternative content at a URL when the previous in-app location matches the interceptor's source route.

Overview

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.

PrefixIntercepts atTypical use
(.)Same levelModal over a list, photo viewer
(..)One level upDetail view from a parent page
(...)App rootModal from anywhere in the app

Convention

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.

app
blog
page.tsx
[slug]
page.tsx
(.)[slug]
page.tsx
/blogRoutable
/blog/:slugRoutable
/blog/:slug (from /blog)Routable

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.

How it works

The interceptor is applied only after a client-side navigation where the previous location matches the interceptor's source route.

app
blog
page.tsx
(.)post
[slug]
B
page.tsx
post
[slug]
A
page.tsx
ADirect visit or reload
example.com/blog/hello
Hello, World
BNavigate from /blog
example.com/blog/hello
Quick preview
/blog/hello
NavigationWhat renders
Visit /blog/:slug directlyThe real [slug] page
Reload /blog/:slugThe real [slug] page
Navigate from /blog to /blog/:slugThe intercepting (.)[slug] page
Navigate from /about to /blog/:slugThe real [slug] page
Interceptors only apply after a client-side navigation. A fresh page load or a hard reload always renders the real page, not the interceptor.

No real page at the target

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.

src/app/(.)modal/page.tsx
// Interceptor only: no real src/app/modal/page.tsx exists
export default function ModalPage() {
  return <div>Modal</div>
}

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 in interceptors

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.

If the real route has a loader, put it on the real page, not the interceptor. The interceptor renders the UI; the real page owns the data.

Complete example

A blog where clicking a post from the list opens an interceptor, but loading the post URL directly shows the full page.

app
blog
page.tsx
(.)post
[slug]
page.tsx
post
[slug]
page.tsx
/blogRoutable
/blog/:slug (from /blog)Routable
/blog/:slug (direct)Routable
NavigationWhat renders
Visit /blog/:slug directlysrc/app/blog/post/[slug]/page.tsx
Reload /blog/:slugsrc/app/blog/post/[slug]/page.tsx
Click a post from /blogsrc/app/blog/(.)post/[slug]/page.tsx
src/app/blog/(.)post/[slug]/page.tsx
export default function PostModal() {
  const { slug } = useParams<{ slug: string }>()

  return (
    <dialog open>
      <h2>Quick preview</h2>
      <p>{slug}</p>
    </dialog>
  )
}

Parallel Routes

Render multiple routes in the same layout with named slots.

Dynamic Routes

Match URL segments with dynamic parameters and catch-alls.

Catch-All Routes

Match any number of trailing URL segments.

Folder-Based Routing

Define routes with folders and page files inside them.

Linking and Navigating

Navigate between routes with Link, useNavigate, and prefetching.

Layouts and Pages

Create your first pages and wrap them in shared layouts.

Was this helpful?
PreviousParallel Routes
NextCatch-All Routes

On this page

  • Overview
  • Convention
  • How it works
  • No real page at the target
  • Data exports in interceptors
  • Complete example
Edit this page on GitHub

Intercepting Routes

Experimental

Render alternative content at a URL when the previous in-app location matches the interceptor's source route.

Overview

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.

PrefixIntercepts atTypical use
(.)Same levelModal over a list, photo viewer
(..)One level upDetail view from a parent page
(...)App rootModal from anywhere in the app

Convention

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.

app
blog
page.tsx
[slug]
page.tsx
(.)[slug]
page.tsx
/blogRoutable
/blog/:slugRoutable
/blog/:slug (from /blog)Routable

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.

How it works

The interceptor is applied only after a client-side navigation where the previous location matches the interceptor's source route.

app
blog
page.tsx
(.)post
[slug]
B
page.tsx
post
[slug]
A
page.tsx
ADirect visit or reload
example.com/blog/hello
Hello, World
BNavigate from /blog
example.com/blog/hello
Quick preview
/blog/hello
NavigationWhat renders
Visit /blog/:slug directlyThe real [slug] page
Reload /blog/:slugThe real [slug] page
Navigate from /blog to /blog/:slugThe intercepting (.)[slug] page
Navigate from /about to /blog/:slugThe real [slug] page
Interceptors only apply after a client-side navigation. A fresh page load or a hard reload always renders the real page, not the interceptor.

No real page at the target

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.

src/app/(.)modal/page.tsx
// Interceptor only: no real src/app/modal/page.tsx exists
export default function ModalPage() {
  return <div>Modal</div>
}

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 in interceptors

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.

If the real route has a loader, put it on the real page, not the interceptor. The interceptor renders the UI; the real page owns the data.

Complete example

A blog where clicking a post from the list opens an interceptor, but loading the post URL directly shows the full page.

app
blog
page.tsx
(.)post
[slug]
page.tsx
post
[slug]
page.tsx
/blogRoutable
/blog/:slug (from /blog)Routable
/blog/:slug (direct)Routable
NavigationWhat renders
Visit /blog/:slug directlysrc/app/blog/post/[slug]/page.tsx
Reload /blog/:slugsrc/app/blog/post/[slug]/page.tsx
Click a post from /blogsrc/app/blog/(.)post/[slug]/page.tsx
src/app/blog/(.)post/[slug]/page.tsx
export default function PostModal() {
  const { slug } = useParams<{ slug: string }>()

  return (
    <dialog open>
      <h2>Quick preview</h2>
      <p>{slug}</p>
    </dialog>
  )
}

Parallel Routes

Render multiple routes in the same layout with named slots.

Dynamic Routes

Match URL segments with dynamic parameters and catch-alls.

Catch-All Routes

Match any number of trailing URL segments.

Folder-Based Routing

Define routes with folders and page files inside them.

Linking and Navigating

Navigate between routes with Link, useNavigate, and prefetching.

Layouts and Pages

Create your first pages and wrap them in shared layouts.

Was this helpful?
PreviousParallel Routes
NextCatch-All Routes

On this page

  • Overview
  • Convention
  • How it works
  • No real page at the target
  • Data exports in interceptors
  • Complete example
Edit this page on GitHub