dynamic route
A route whose folder name is in square brackets, such as [slug], so one page file serves many URLs.
In more detail
app/blog/[slug]/page.tsx answers /blog/hello and /blog/world; the matched text arrives in params.slug. Combine with generateStaticParams to pre-render known values at build time.
Related terms
- slug — A short, readable, URL-safe name for a record, such as next-15-release in /blog/next-15-release.
- params — The object holding the values matched by a route's dynamic segments, such as { slug: 'hello' }.
- catch-all segment — A dynamic segment written [...slug] that matches one or more path parts and returns them as an array.
- generateStaticParams — A function exported from a dynamic route that lists the param values to pre-render as static pages at build time.
Taught in
- Templates vs Layouts: Remounting & Page Transitions — Next.js 15 & Modern App Router Architecture
- Dynamic Routes: Slugs & generateStaticParams — Next.js 15 & Modern App Router Architecture
- Full Route Cache: Static Rendering & Segment Config — Next.js 15 & Modern App Router Architecture
- Router Cache: In-Memory Client Prefetch Semantics — Next.js 15 & Modern App Router Architecture
- Metadata API: Dynamic OpenGraph & Head Management — Next.js 15 & Modern App Router Architecture