file convention
A file name that Next.js gives a special meaning, such as page.tsx for a route's content or error.tsx for its error screen.
In more detail
Next.js finds these files by name inside app/ and wires them together for you: layout wraps template, which wraps error, loading and not-found boundaries, which wrap the page. Any other file name is ignored by the router.
Related terms
- app directory — The folder, app/ or src/app/, whose subfolders and special files define every route in an App Router project.
- page.tsx — The special file that makes a route segment publicly reachable and holds the content shown at that URL.
- layout.tsx — The special file that wraps a segment and all its children in shared UI that stays mounted while you navigate between them.
- loading.tsx — A special file whose component Next.js shows instantly while a route segment's page is loading, by wrapping the page in Suspense.
Taught in
- Route Groups & Private Folders: Modular Structures — Next.js 15 & Modern App Router Architecture
- Loading UI: Instant Loading States with loading.tsx — Next.js 15 & Modern App Router Architecture
- Not Found Handling: not-found.tsx & Programmatic Exits — Next.js 15 & Modern App Router Architecture
- Metadata API: Dynamic OpenGraph & Head Management — Next.js 15 & Modern App Router Architecture