Next.js is a free, open-source React meta-framework built and maintained by Vercel, adding server-side rendering, file-based routing, and API routes on top of React. It's the most popular React meta-framework, reported in roughly 20.8% of developer surveys, and has become the default way most new React applications get built. It solves problems React alone doesn't โ like SEO-friendly server rendering and a built-in routing system โ without needing to hand-assemble a build toolchain.
In the App Router, a folder path under app/ becomes a route, and a page.tsx file inside it is the page component โ server-rendered by default.
// app/products/[id]/page.tsx
export default async function ProductPage({ params }: { params: { id: string } }) {
const res = await fetch(`https://api.example.com/products/${params.id}`);
const product = await res.json();
return (
<main>
<h1>{product.name}</h1>
<p>${product.price}</p>
</main>
);
}
The official CLI scaffolds a fully configured project, including TypeScript, ESLint, and the App Router.
# scaffold a new Next.js app
npx create-next-app@latest my-app
cd my-app
npm run dev