catch-all segment

A dynamic segment written [...slug] that matches one or more path parts and returns them as an array.

In more detail

app/docs/[...slug]/page.tsx matches /docs/a and /docs/a/b/c, giving slug as ['a'] or ['a', 'b', 'c']. Double brackets, [[...slug]], also match the bare /docs.

Related terms

Taught in

References