LearnAI ToolsCareerPractice BuildsPlayContact
Lesson 1212 min read

Route Groups

Use parenthesized folder names to organize routes and apply different layouts without changing the URL.

What Is a Route Group?

Wrapping a folder name in parentheses, like (marketing), creates a route group: the folder organizes your project and can hold its own layout.tsx, but its name is excluded entirely from the URL.

app/
├── (marketing)/
│ ├── layout.tsx → applies only to pages in this group
│ ├── page.tsx → /
│ └── about/page.tsx → /about
└── (app)/
├── layout.tsx → a different layout for these pages
└── dashboard/page.tsx → /dashboard

Note that neither (marketing) nor (app) appears anywhere in the resulting URLs — they exist purely for organization at the file-system level.

Example: Marketing vs App Layouts

A common real-world use is giving a public marketing site (home, pricing, about) a completely different layout — header, footer, marketing nav — from the logged-in application (dashboard, settings) without either affecting the other's URLs or bleeding into each other's layout.

Why Use Route Groups

  • Apply different root-level layouts to different sections of a site.
  • Organize a large route tree into logical folders without changing any URLs.
  • Opt specific sections into a shared loading.tsx or error.tsx boundary.

Common Beginner Mistakes

Expecting the group name in the URL

A file at app/(marketing)/about/page.tsx renders at /about, not /marketing/about — the parentheses always drop out.

Defining the same route in two groups

If (marketing) and (app) both define a page.tsx for /, Next.js can't resolve which one wins — this causes a build error.

FAQs

Yes — a project commonly has several, like (marketing), (app), and (auth), each with its own layout.

No — route groups (parentheses) still allow routing inside them, just without adding to the URL. Private folders (underscore) opt out of routing entirely.

Summary

Route groups let you organize files and apply different layouts without any impact on the URLs visitors see. Next, you'll learn how to build routes with dynamic segments, like a blog post slug.

Next Lesson →

Dynamic Routes