- All Courses
- Next.js App Router in Depth
- Routing and Layouts
- Layouts, templates, and shared UI
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.
- 6m
- Intermediate

Video by Code Ryan · YouTube
Check your understanding
3 questions. Unlocks when you finish the video.
Overview
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
Resources
Your notes will live here
Note taking is not available yet. Nothing you type would be saved, so the tab stays read-only for now.