You are viewing the docs for the App Router (beta)

Next 13 (stable) docs →

`app` directory (beta) ↓

Next 13 (stable) docs →

Skip to content

Next.js

Next.js Logo
Next.js LogoShowcaseDocsBlogAnalyticsTemplatesEnterprise
Deploy
Getting Started
Installation
Upgrade Guide
App Router Roadmap

Building Your Application

Fundamentals
Defining Routes
Pages and Layouts
Linking and Navigating
Loading UI
Error Handling
Route Handlers
Fundamentals
Server and Client Components
Static and Dynamic Rendering
Edge and Node.js Runtimes
Fundamentals
Fetching
Caching
Revalidating
Mutating
Streaming and Suspense
Generating Static Params
API Routes
CSS Modules
Tailwind CSS
Global Styles
CSS-in-JS
External Stylesheets
Sass
Images
Fonts
Scripts
OG Image Generation
Static Assets
Lazy Loading
Middleware
Environment Variables
Deployment Guide
next.config.js
Static Export
TypeScript
Turbopack
ESLint
Absolute Imports and Module Path Aliases

API Reference

Link
Image
Font
Script
Layout
Page
Loading
Error
Template
Head
Not Found
Route
cookies
fetch
headers
generateStaticParams
notFound
redirect
NextRequest
NextResponse
useRouter
useParams
useSearchParams
useSelectedLayoutSegment
useSelectedLayoutSegments
usePathname
Edge Runtime
Segment Config Options
Metadata
create-next-app
Next.js CLI

Guides

Version 12
Version 11
Version 10
Version 9
Codemods
Debugging
Accessibility
AMP
Authentication
CMS
Forms
Internationalization
Markdown and MDX
SEO
Testing
Getting Started
Installation
Upgrade Guide
App Router Roadmap

Building Your Application

Fundamentals
Defining Routes
Pages and Layouts
Linking and Navigating
Loading UI
Error Handling
Route Handlers
Fundamentals
Server and Client Components
Static and Dynamic Rendering
Edge and Node.js Runtimes
Fundamentals
Fetching
Caching
Revalidating
Mutating
Streaming and Suspense
Generating Static Params
API Routes
CSS Modules
Tailwind CSS
Global Styles
CSS-in-JS
External Stylesheets
Sass
Images
Fonts
Scripts
OG Image Generation
Static Assets
Lazy Loading
Middleware
Environment Variables
Deployment Guide
next.config.js
Static Export
TypeScript
Turbopack
ESLint
Absolute Imports and Module Path Aliases

API Reference

Link
Image
Font
Script
Layout
Page
Loading
Error
Template
Head
Not Found
Route
cookies
fetch
headers
generateStaticParams
notFound
redirect
NextRequest
NextResponse
useRouter
useParams
useSearchParams
useSelectedLayoutSegment
useSelectedLayoutSegments
usePathname
Edge Runtime
Segment Config Options
Metadata
create-next-app
Next.js CLI

Guides

Version 12
Version 11
Version 10
Version 9
Codemods
Debugging
Accessibility
AMP
Authentication
CMS
Forms
Internationalization
Markdown and MDX
SEO
Testing

template.js

ErrorHead