App Router Foundations

Routing and layouts

Next.js App Router uses folders to describe URL segments. layout.tsx can preserve shared UI while page.tsx represents route content.

text
app/
  page.tsx
  courses/
    page.tsx
    [slug]/
      page.tsx
  layout.tsx
  • Use route folders for organization.
  • Use dynamic segments for content-driven pages.
  • Use layouts for shared navigation and persistent shells.
Lesson complete?Use the next lesson to continue the learning path.