Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
A simple implementation of preview modals with Next.js intercepting & parallel routes
Next Intercepting Routes Demo is a Next.js 13.3 boilerplate that shows how to build preview modals using intercepting routes and parallel routes, so a modal opens on navigation and the full page renders on refresh. Created by developer Krish Nerker, this public demo project mirrors the preview pattern used on Product Hunt and is ready to run locally or deploy to Vercel.
This is a minimal example project, written in TypeScript, that showcases two routing features introduced in Next.js 13.3: parallel routes and route interception. It takes a page with a list of items and displays a modal preview when an item is clicked; refreshing the page on the modal URL renders the full content page instead of the modal. The project runs on Next.js and uses Tailwind CSS and PostCSS for styling, as noted in the repository metadata.
The repository uses the Next.js App Router. A parallel slot defines the modal region, and an intercepting route captures navigation that would normally trigger a full page change. When a link is clicked, Next.js renders the matching route inside the modal slot; when the same URL is requested directly, such as on refresh, Next.js falls back to the full page. To run the project, clone the repo, run npm install, and then npm run dev, as documented in the README.
Yes. Intercepting routes and parallel routes were introduced in Next.js 13.3, so older versions will not render the modal or fall back to the full page correctly.
Yes. The README links to a working demo at https://next-intercepting-routes-demo.vercel.app/ where you can click items and refresh to see the full-page behavior.
Clone the repository, install dependencies with npm install, and start the development server with npm run dev. The README documents these three steps.
Yes, the repository includes a Deploy with Vercel button in the README. It creates a new project from the GitHub URL with one click.
