Component hierarchy

The components defined in special files are rendered in a specific hierarchy:

image.png

The components are rendered recursively in nested routes, meaning the components of a route segment will be nested inside the components of its parent segment.

image.png

In the app directory, nested folders define route structure. Each folder represents a route segment that is mapped to a corresponding segment in a URL path.

Private folders

Private folders can be created by prefixing a folder with an underscore: _folderName

This indicates the folder is a private implementation detail and should not be considered by the routing system, thereby opting the folder and all its subfolders out of routing.

image.png

Route groups

Route groups can be created by wrapping a folder in parenthesis: (folderName)

This indicates the folder is for organizational purposes and should not be included in the route's URL path.

image.png