0
0
NextJSframework~10 mins

Intercepting routes (.) in NextJS - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Intercepting routes (.)
User clicks a link
Next.js Router intercepts
Check if route is intercepted
Render rest of page
Update browser URL
When a user clicks a link, Next.js router checks if the route has an intercepted segment (marked by a dot). If yes, it renders that segment separately inside the page without full reload.
Execution Sample
NextJS
app/dashboard/page.tsx
app/dashboard/(.)/settings/page.tsx

// User navigates from /dashboard to /dashboard/(.)/settings
This code shows a main dashboard page and an intercepted settings page inside the dashboard route using (.) folder.
Execution Table
StepActionRouteIntercepted SegmentRendered ComponentsBrowser URL
1User clicks link to /dashboard/dashboardNoDashboard page/dashboard
2User clicks link to /dashboard/(.)/settings/dashboard/(.)/settingsYes (.) segment 'settings'Dashboard page + Settings segment/dashboard/settings
3Next.js router intercepts route/dashboard/(.)/settingsYesDashboard page + Settings segment/dashboard/settings
4Render intercepted segment without full reload/dashboard/(.)/settingsYesDashboard + Settings segment rendered/dashboard/settings
5User navigates away to /profile/profileNoProfile page/profile
6Exit----
💡 User navigates away or no intercepted route found, normal routing resumes.
Variable Tracker
VariableStartAfter Step 2After Step 4Final
Route/dashboard/dashboard/(.)/settings/dashboard/(.)/settings/profile
InterceptedSegmentNonesettingssettingsNone
RenderedComponentsDashboardDashboard + SettingsDashboard + SettingsProfile
BrowserURL/dashboard/dashboard/settings/dashboard/settings/profile
Key Moments - 3 Insights
Why does the URL show /dashboard/settings but the route folder is /dashboard/(.)/settings?
Next.js hides the (.) folder in the URL for clean paths. The execution_table rows 2-4 show the route path includes (.) but the browser URL omits it.
Does the whole page reload when navigating to an intercepted route?
No, only the intercepted segment loads inside the existing page. See execution_table row 4 where Dashboard stays rendered and Settings loads inside.
What happens if the route is not intercepted?
Next.js performs a full page render for that route as normal. Execution_table row 1 and 5 show no intercepted segment and full page renders.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the Rendered Components at Step 3?
ADashboard page only
BSettings segment only
CDashboard + Settings segment
DProfile page
💡 Hint
Check the 'Rendered Components' column at Step 3 in the execution_table.
At which step does the browser URL update to /dashboard/settings?
AStep 1
BStep 2
CStep 4
DStep 5
💡 Hint
Look at the 'Browser URL' column in the execution_table for when it first shows /dashboard/settings.
If the user navigates to /profile, what happens to the InterceptedSegment variable?
AIt becomes None
BIt stays as 'settings'
CIt changes to 'profile'
DIt becomes '/'
💡 Hint
Check the variable_tracker row for InterceptedSegment at the Final column.
Concept Snapshot
Intercepting routes (.) in Next.js lets you load parts of a page separately.
Use a folder named (.) inside a route to mark intercepted segments.
When navigating, Next.js renders the intercepted segment inside the main page.
The URL hides the (.) folder for clean paths.
This avoids full page reloads and improves user experience.
Full Transcript
Intercepting routes in Next.js uses a special folder named (.) inside a route folder. When a user clicks a link, Next.js router checks if the route includes an intercepted segment inside (.). If yes, it loads that segment inside the existing page without a full reload. The browser URL hides the (.) folder for a clean path. For example, navigating from /dashboard to /dashboard/(.)/settings renders the settings segment inside the dashboard page, but the URL shows /dashboard/settings. This improves speed and smoothness. If the route is not intercepted, Next.js loads the full page normally. Variables like Route, InterceptedSegment, RenderedComponents, and BrowserURL update step-by-step as shown in the execution table and variable tracker.