HeliumTS is under active development. Expect bugs and breaking changes. If you find any issues, please report them in our GitHub
A stable release is planned for early 2026.
Route Groups
Route groups let you organize pages into logical sections without changing the final URL. Any folder wrapped in parentheses is stripped from the route path but still participates in layout resolution.
Basic Structure
1src/pages/2├── (website)/3│ ├── _layout.tsx4│ ├── index.tsx → /5│ ├── about.tsx → /about6│ └── contact.tsx → /contact7├── (portal)/8│ ├── _layout.tsx9│ ├── dashboard.tsx → /dashboard10│ └── tasks.tsx → /tasks11└── (auth)/12 ├── _layout.tsx13 ├── login.tsx → /login14 └── register.tsx → /register
In the example above, (website), (portal), and (auth) are organizational folders only. They never appear in the browser URL.
Why Use Route Groups
- Split marketing, application, admin, or auth flows without polluting URLs.
- Attach different layouts to different parts of the app.
- Keep feature areas isolated while preserving file-based routing.
- Group future SSR or SSG pages by concern instead of by URL shape.
Layouts and Hierarchy
Layouts are resolved using the real folder structure, including route groups. That means group layouts stay isolated, while the root layout still wraps everything.
1src/pages/2├── _layout.tsx # RootLayout - all pages3├── (portal)/4│ ├── _layout.tsx # PortalLayout - only portal pages5│ ├── dashboard.tsx # [RootLayout → PortalLayout]6│ └── settings/7│ ├── _layout.tsx # SettingsLayout - only settings pages8│ └── profile.tsx # [RootLayout → PortalLayout → SettingsLayout]9└── (website)/10 ├── _layout.tsx # WebsiteLayout - only website pages11 └── about.tsx # [RootLayout → WebsiteLayout]
Dynamic Routes Inside Groups
Route groups work the same way with dynamic and catch-all routes. Only the folder name in parentheses is removed.
1src/pages/2└── (portal)/3 ├── tasks/4 │ ├── index.tsx → /tasks5 │ └── [id].tsx → /tasks/:id6 └── docs/7 └── [...slug].tsx → /docs/*
Collision Detection
If two files resolve to the same public route, HeliumTS warns and only the first file wins.
1❌ Route collision detected! Multiple files resolve to the same path "/":2 - /src/pages/index.tsx3 - /src/pages/(website)/index.tsx4Only the first file will be used.
Common collision sources are duplicate index.tsx files, repeated filenames across groups, or mixing grouped and non-grouped pages for the same URL.
Best Practices
- Use the root layout for global providers and chrome.
- Use group layouts for section-specific navigation, auth gates, or themes.
- Choose descriptive group names like
(marketing),(app), or(admin). - Avoid deep nesting unless the UI hierarchy genuinely needs it.