Route Groups
Route groups let you organize routes without affecting the URL path. They're defined using parentheses: (folderName).
Basic Usage
Group related routes without adding URL segments:
app/
āāā (marketing)/
ā āāā about/
ā ā āāā page.tsx ā /about
ā āāā blog/
ā ā āāā page.tsx ā /blog
ā āāā pricing/
ā āāā page.tsx ā /pricing
āāā (dashboard)/
āāā settings/
ā āāā page.tsx ā /settings
āāā profile/
āāā page.tsx ā /profile
Notice: (marketing) and (dashboard) don't appear in URLs.
Multiple Layouts
The main use case: different layouts for different sections.
app/
āāā (marketing)/
ā āāā layout.tsx ā Marketing layout
ā āāā page.tsx ā / (homepage)
ā āāā about/
ā ā āāā page.tsx
ā āāā pricing/
ā āāā page.tsx
āāā (app)/
āāā layout.tsx ā App layout
āāā dashboard/
ā āāā page.tsx
āāā settings/
āāā page.tsx
// app/(marketing)/layout.tsx
export default function MarketingLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<div>
<MarketingHeader />
{children}
<MarketingFooter />
</div>
)
}
// app/(app)/layout.tsx
export default function AppLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<div>
<Sidebar />
<main>{children}</main>
</div>
)
}
Multiple Root Layouts
You can have multiple root layouts for completely different app sections:
app/
āāā (marketing)/
ā āāā layout.tsx ā Own <html>, <body>
ā āāā page.tsx
āāā (dashboard)/
āāā layout.tsx ā Different <html>, <body>
āāā page.tsx
// app/(marketing)/layout.tsx
export default function MarketingLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html lang="en">
<body className="marketing-theme">
{children}
</body>
</html>
)
}
// app/(dashboard)/layout.tsx
export default function DashboardLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html lang="en">
<body className="dashboard-theme">
{children}
</body>
</html>
)
}
Note: Navigation between different root layouts causes a full page reload.
Organizing by Feature
Group by feature or domain instead of type:
app/
āāā (shop)/
ā āāā products/
ā ā āāā page.tsx
ā āāā cart/
ā ā āāā page.tsx
ā āāā checkout/
ā āāā page.tsx
āāā (blog)/
ā āāā posts/
ā ā āāā page.tsx
ā āāā categories/
ā āāā page.tsx
āāā (account)/
āāā profile/
ā āāā page.tsx
āāā orders/
āāā page.tsx
Combining with Other Patterns
With Dynamic Routes
app/
āāā (shop)/
āāā products/
āāā [category]/
āāā [id]/
āāā page.tsx ā /products/shoes/nike-123
With Catch-All Routes
app/
āāā (docs)/
āāā [...slug]/
āāā page.tsx ā /any/nested/path
With Parallel Routes
app/
āāā (dashboard)/
āāā layout.tsx
āāā @stats/
ā āāā page.tsx
āāā @notifications/
āāā page.tsx
Common Patterns
Auth vs Non-Auth Layouts
app/
āāā (public)/
ā āāā layout.tsx ā No auth required
ā āāā page.tsx
ā āāā pricing/
āāā (protected)/
āāā layout.tsx ā Requires auth
āāā dashboard/
āāā settings/
Versioned API or Layouts
app/
āāā (v1)/
ā āāā layout.tsx ā V1 design system
āāā (v2)/
āāā layout.tsx ā V2 design system
Summary
- Route groups use
(folderName)- parentheses don't affect URLs - Main use: apply different layouts to different sections
- Can create multiple root layouts (full page reload between them)
- Great for organizing by feature, auth status, or design version
- Combine freely with dynamic routes, parallel routes, etc.

