Three flavors of dynamic segment
| Folder pattern | Example URL | params shape |
|---|---|---|
[slug] | /blog/hello | { slug: 'hello' } |
[...slug] | /docs/a/b/c | { slug: ['a','b','c'] } |
[[...slug]] | /docs or /docs/a/b | { slug: undefined } or { slug: ['a','b'] } |
Multiple segments combine cleanly
You can have several dynamic segments in one path. params is the shape of all of them merged into a single object.
404 vs render
If a request hits /blog/foo and no generateStaticParams pre-built it, the default behavior is to render on demand. Set export const dynamicParams = false if you want unknown slugs to 404 instead.