Home
Next.js
Next.js Routing: The 5 Patterns
Daniel Nguyen
Daniel Nguyen
September 22, 2026
1 min

Table Of Contents

01
1. Static Routes
02
2. Nested Routes
03
3. Dynamic Routes [slug]
04
4. Catch-all Routes [...slug]
05
5. Route Groups (group)
06
And There Are More...

Next.js App Router uses your folder structure to create routes. No separate router config needed.

Next.js routing patterns: folders become routes
Next.js routing patterns: folders become routes

1. Static Routes

The simplest one.

app/
├── page.tsx
├── about/
│ └── page.tsx
└── contact/
└── page.tsx

This gives you:

/
/about
/contact

2. Nested Routes

Folders can be nested to create deeper URLs.

app/
└── blog/
└── tutorials/
└── page.tsx

/blog/tutorials


3. Dynamic Routes [slug]

This is probably the one you’ll use the most.

app/
└── blog/
└── [slug]/
└── page.tsx

slug is the dynamic part of the URL. You can read it from params:

export default async function Page({params,}: {params: Promise<{ slug: string }>}) {
const { slug } = await params
return <h1>{slug}</h1>
}

For /blog/nextjs, slug is "nextjs".


4. Catch-all Routes [...slug]

Sometimes you need to match multiple URL segments.

app/
└── docs/
└── [...slug]/
└── page.tsx

Think of it as:

[slug] → one segment
[...slug] → one or more segments

Useful for documentation, CMS pages, or deep category structures.


5. Route Groups (group)

Route Groups are mainly for organizing your app.

app/
├── (marketing)/
│ ├── about/
│ └── pricing/
└── (dashboard)/
└── dashboard/

The (marketing) and (dashboard) parts don’t appear in the URL.

They’re useful when you want different layouts or want to keep a large project organized.


And There Are More…

Next.js also has some more advanced routing patterns:

PatternSyntaxUse case
Parallel Routes@slotRender multiple UI sections in parallel
Intercepting Routes(.), (..)Intercept a route, commonly for modals

You probably don’t need these on day one.


Tags

#NextJS

Share

Daniel Nguyen

Daniel Nguyen

Frontend Developer

Frontend developer specializing in React, Next.js, and JavaScript. Writing practical guides on modern web development at Dev98.

Expertise

React
Next.js
JavaScript
TypeScript
Python

Social Media

githublinkedinyoutubewebsite

Related Posts

Next.js
GSAP in Next.js: A Practical Guide
September 29, 2026
1 min
Dev98

Dev98

React · Next.js · Web development