How File-Based Routing Works in the Next.js App Router
Next.js turns folders inside app into URLs. Learn how nesting, page files, and layouts combine to build your app's routes.
Full-stack React framework
Next.js turns folders inside app into URLs. Learn how nesting, page files, and layouts combine to build your app's routes.
A catch-all route matches many URL segments with one folder. Learn the difference between catch-all and optional catch-all syntax and when each fits.
Parallel routes render more than one page in the same layout at once, each with its own loading and error state. Learn the @slot convention.
Intercepting routes load one route inside the current layout while masking the URL, which is what lets a photo open as a modal instead of a new page.
Layouts cannot pass data to the pages they wrap, and pages cannot pass data up to a layout. Learn the real patterns for sharing data between them.
The Link component moves readers between pages without a full reload. Learn its props, its prefetch behavior, and when to reach for it over a plain anchor.
Clicking a Next.js Link does not reload the page. See the steps between the click and the new content appearing, and why it feels instant.
useSelectedLayoutSegment reads which route segment is active one level below a layout, which makes it a natural fit for highlighting an active nav link.
useLinkStatus tells a component inside a Link whether that navigation is still pending, which is how you show a loading indicator on a slow link.
With Cache Components enabled, navigating away from a page and back no longer resets its state. Learn how React's Activity component makes that happen.
Wrap changing content in React's ViewTransition component to animate it across a Next.js navigation, with no extra config and no effect on the click itself.
This build error means a Server Component's module graph reached a hook that only works in a Client Component. Here is the smallest repro, the cause, and the two fixes.