A layout is UI that is shared between multiple pages. On navigation, layouts preserve state, remain interactive, and do not rerender. You can define a layout by default exporting a React component from a layout file. The component should accept a children prop which can be a page or another layout.
The layout file is used to define a layout in your Next.js application.
The app directory must include a root app/layout.js
The root layout must define <html> and <body> tags- but not manually but using Metadata API.
You can nest layouts.
Layouts can be defined at specific route segment(folders).
layout receive children(required) and params(optional) props
Layouts do not receive searchParams
Layouts cannot access pathname.