layout.tsx

The special file that wraps a segment and all its children in shared UI that stays mounted while you navigate between them.

In more detail

Layouts receive the child page or layout as children. Because they do not re-render on navigation, their state and fetched data survive route changes, but they also cannot read the current searchParams. Layouts nest: a parent layout wraps every child layout below it.

Related terms

Taught in

References