Next.js guides
Every published Next.js guide, newest first, with practical examples you can copy into your own project.
3,815 guides across 14 topics
Topics
Popular Next.js guides
Most readNext.js Static Export, Standalone Output, and Docker Deployment
Next.js Parallel Routes and Intercepting Routes: Slot Layouts and Modals
Next.js ISR: Route Revalidate, revalidateTag, and On-Demand Invalidation
Next.js Environment Variables: NEXT_PUBLIC_, Build-Time Inlining, and Runtime Config
Latest Next.js guides
Page 1 of 2Next.js Redirects, Rewrites, and Headers in next.config.ts
Redirect changes the URL, rewrite masks it, headers ride on the response — all evaluated in a fixed order before routing. Permanent means cached in browsers, not just in Google.
Next.js Static Export, Standalone Output, and Docker Deployment
Export has no server, standalone has a pruned one, and the default expects a full install. The three COPY lines that decide whether a container renders CSS.
Next.js Edge Runtime vs Node.js Runtime: Limits, Latency, and Use Cases
Edge gives near-zero cold starts and Web APIs only; Node gives sockets, files, and a fixed region. Why database work belongs on Node, and what fails at build time.
Next.js Link and Router: useRouter, usePathname, and useSearchParams
Client navigation goes through Link and the router hooks, the server uses redirect(). The Suspense requirement, prefetch cost, and query string handling that breaks first.
Testing Next.js: Vitest for Server Components and Playwright for the Rest
Async Server Components cannot render in jsdom, so awaiting the component is the unit test and a real browser is the integration test. What each layer actually proves.
Next.js Environment Variables: NEXT_PUBLIC_, Build-Time Inlining, and Runtime Config
The prefix decides whether a value is compiled into the browser bundle or stays on the server. One image, two environments, and the choice that follows from it.
Next.js Authentication: Sessions, Cookies, and Server-Side Protection
HttpOnly cookies set only in actions, an async cookies() API, and one data-access layer. Middleware is an optimistic gate; the page that reads data is the only real check.
Next.js i18n: Locale Routing, Middleware Negotiation, and Dictionaries
A [lang] segment gives every page a static, cacheable URL per language and middleware negotiates once. Where static rendering silently becomes dynamic, and how hreflang stays honest.
Next.js ISR: Route Revalidate, revalidateTag, and On-Demand Invalidation
Two clocks and one trigger: route revalidate seconds, fetch-level tags, and a webhook that calls revalidateTag. A timer is a ceiling on freshness, never a guarantee.
Next.js Parallel Routes and Intercepting Routes: Slot Layouts and Modals
Named slots render several pages in one layout, and (.) interception makes a click open over the page while a direct link renders the full route. Why every slot needs default.tsx.