Lesson 1.26mIntermediate17.3k students
Layouts, templates, and shared UI
Layouts persist across navigations and keep their state; templates remount on every navigation. Choosing the wrong one is why your sidebar scroll position keeps resetting.
This lesson sits in Routing and Layouts, part of Next.js App Router in Depth. It assumes what came before it and leads directly into the next lesson in the module.
In this lesson you will
- Nest layouts to share chrome across a section
- Know when state persistence makes a template the wrong choice
- Colocate loading and error UI with the layout it belongs to
Resources
Your notes for this lesson will appear here.