Vercel

Next.js Layouts RFC in 5 minutes

Sep 14, 2022
Next.js Layouts RFC in 5 minutes
SummaryAI, from the source post

This post details the introduction of the `app` directory in Next.js, which redefines routing and layout management. Key features include folder-based routing, `page.js` for route UI, `layout.js` for shared and nested layouts, `loading.js` for Suspense-based loading states, `error.js` for error boundaries, and route groups for organizing routes without affecting URLs or opting out of layouts. The post demonstrates incremental adoption from the `pages` directory and provides code examples for creating routes, layouts, and handling nested structures.

More from the Framework-Defined Infrastructure trail