prefetch 'partial' option
The 'partial' value opts the segment into Partial Prefetching without enabling the global partialPrefetching flag. A <Link> pointing at a segment with prefetch = 'partial' loads the per-route App Shell instead of the legacy full prefetch. Set this on the destination, not the link. For links that opt into a wider prefetch with <Link prefetch={true}>, Next.js uses per-link prefetching and the server renders a fresh response that resolves URL data (params, searchParams, and the full URL). On pages where all content is statically renderable, Next.js serves prefetches from the static cache. If a page accesses non-static data, it's prefetched at runtime. Use this for incremental adoption when you can't enable partialPrefetching for the entire app at once.
prefetch export requirements
The prefetch export only works when cacheComponents is enabled. The prefetch export cannot be used when the segment is a Client Component. The meaningful values to set are 'partial' and 'force-disabled'. The value 'auto' is the default and is equivalent to omitting the export; do not write prefetch = 'auto' explicitly.
prefetch route segment config overview
The prefetch route segment config controls how a segment is prefetched during client-side navigation. By default, the framework manages the strategy based on the app's partialPrefetching setting. To override per segment, set the prefetch export to one of the values: 'auto', 'partial', or 'force-disabled'.
prefetch version history
The prefetch export was introduced in v16.x.x (Cache Components only).
prefetch export example
export const prefetch = 'partial'
export default function Page() {
return <div>...</div>
}
This example shows how to set the prefetch export to 'partial' in a layout.tsx or page.tsx file.
prefetch static vs non-static content caching
On pages where all content is statically renderable, Next.js serves prefetches from the static cache or a CDN. If a page accesses non-static data like cookies or headers, it's prefetched at runtime with a fresh server render, which costs server CPU per page view.
create-next-app recommended defaults
The recommended Next.js defaults include TypeScript, ESLint, Tailwind CSS, App Router, and AGENTS.md.
create-next-app CLI options reference
Available create-next-app options are: -h or --help (show all available options), -v or --version (output the version number), --no-* (negate default options, e.g. --no-ts), --ts or --typescript (initialize as TypeScript project, default), --js or --javascript (initialize as JavaScript project), --tailwind (initialize with Tailwind CSS config, default), --react-compiler (initialize with React Compiler enabled), --eslint (initialize with ESLint config), --biome (initialize with Biome config), --no-linter (skip linter configuration), --app (initialize as App Router project), --api (initialize a project with only route handlers), --src-dir (initialize inside a src/ directory), --turbopack (force enable Turbopack in generated package.json, enabled by default), --webpack (force enable Webpack in generated package.json), --import-alias <alias-to-configure> (specify import alias to use, default "@/*"), --empty (initialize an empty project), --use-npm (explicitly tell the CLI to bootstrap using npm), --use-pnpm (explicitly tell the CLI to bootstrap using pnpm), --use-yarn (explicitly tell the CLI to bootstrap using Yarn), --use-bun (explicitly tell the CLI to bootstrap using Bun), -e or --example [name] [github-url] (an example to bootstrap the app with), --example-path <path-to-example> (specify the path to the example separately), --reset-preferences (explicitly tell the CLI to reset any stored preferences), --skip-install (explicitly tell the CLI to skip installing packages), --disable-git (explicitly tell the CLI to disable git initialization), --agents-md (include AGENTS.md and CLAUDE.md to guide coding agents, default), --yes (use previous preferences or defaults for all options).
create-next-app CLI basic usage
The create-next-app CLI allows creating a new Next.js application using the default template or an example from a public GitHub repository. It is the easiest way to get started with Next.js. Basic usage commands are: pnpm create next-app [project-name] [options], npx create-next-app@latest [project-name] [options], yarn create next-app [project-name] [options], or bun create next-app [project-name] [options].
create-next-app customize settings prompts
When customizing settings with create-next-app, the prompts are: Would you like to use TypeScript? (No/Yes), Which linter would you like to use? (ESLint/Biome/None), Would you like to use React Compiler? (No/Yes), Would you like to use Tailwind CSS? (No/Yes), Would you like your code inside a src/ directory? (No/Yes), Would you like to use App Router? (recommended) (No/Yes), Would you like to customize the import alias (@/* by default)? (No/Yes), What import alias would you like configured? (@/* default), Would you like to include AGENTS.md to guide coding agents to write up-to-date Next.js code? (No/Yes).
Linter options in create-next-app
ESLint is the traditional and most popular JavaScript linter and includes Next.js-specific rules from @next/eslint-plugin-next. Biome is a fast, modern linter and formatter that combines the functionality of ESLint and Prettier, with built-in Next.js and React domain support. None option skips linter configuration entirely and allows adding a linter later.
create-next-app with official example
To create a new app using an official Next.js example, use the --example flag with the example name. For example: pnpm create next-app --example [example-name] [your-project-name], npx create-next-app@latest --example [example-name] [your-project-name], yarn create next-app --example [example-name] [your-project-name], or bun create next-app --example [example-name] [your-project-name]. Available examples can be viewed in the Next.js repository.
create-next-app with public GitHub example
To create a new app using any public GitHub example, use the --example option with the GitHub repository's URL. For example: pnpm create next-app --example "https://github.com/.../" [your-project-name], npx create-next-app@latest --example "https://github.com/.../" [your-project-name], yarn create next-app --example "https://github.com/.../" [your-project-name], or bun create next-app --example "https://github.com/.../" [your-project-name].