root layout
The required top-level layout that wraps every route and must render the html and body tags.
In more detail
It is the place for global fonts, analytics scripts and metadata defaults. Route groups can give different parts of the app separate root layouts; navigating between them causes a full page load.
Related terms
- layout.tsx — The special file that wraps a segment and all its children in shared UI that stays mounted while you navigate between them.
- route group (Next.js) — A folder whose name is in parentheses, such as (marketing), that organises routes without adding to the URL.
- HTML — The markup language that describes the structure and meaning of a web page with elements such as <button>, <input> and <h2>.
Taught in
- Root & Nested Layouts: State Preservation Semantics — Next.js 15 & Modern App Router Architecture
- Route Groups & Private Folders: Modular Structures — Next.js 15 & Modern App Router Architecture
- Error Boundaries: Nested error.tsx & Reset Logic — Next.js 15 & Modern App Router Architecture
- Image & Font Optimization: Zero Layout Shift Assets — Next.js 15 & Modern App Router Architecture
- Script Optimization: next/script & Lazy Third Parties — Next.js 15 & Modern App Router Architecture