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.

