private folder
A folder whose name starts with an underscore, such as _components, which the router ignores entirely.
In more detail
Private folders keep helpers, components and tests next to the routes that use them with no chance of becoming a URL. Visiting the path returns 404.
Related terms
- colocation — Keeping files that belong together, such as a page, its components and its tests, in the same folder.
- route group (Next.js) — A folder whose name is in parentheses, such as (marketing), that organises routes without adding to the URL.
Taught in
- Dynamic Routes: Slugs & generateStaticParams — Next.js 15 & Modern App Router Architecture
- Route Groups & Private Folders: Modular Structures — Next.js 15 & Modern App Router Architecture