Nested layouts

A layout is an interface shared by several pages of a segment, defined in layout.tsx: header, navigation, footer. Layouts nest according to the folder tree, and they preserve their state and do not re-render when navigating between child pages.

Example

export default function Layout({ children }) {
  return <main>{children}</main>
}

Related concepts

The whole glossary