File conventions

Root layout

Root layouts provide the document shell; nested layouts render descendants through children. Layout params are asynchronous in the 16.x lane. A layout is not a suitable source of fresh query parameters. Source: https://nextjs.org/docs/app/api-reference/file-conventions/layout. Documentation-reviewed illustrative draft; installed declarations and runtime not verified.

Formal Syntax & Structure

nextjs syntaxnextjs
app/layout.tsx

Working Example

Example Snippetnextjs
import type { ReactNode } from 'react';export default function RootLayout({children}: {children: ReactNode}) { return <html lang='en'><body>{children}</body></html>;}
Next.js Reference