Lesson 1.2
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.
6mIntermediate17,298 students

Sign in to watch this lesson
Browsing is free. Create an account to play videos and track your progress.
Overview
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.
What this lesson covers
- 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
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