nextjs-routing-advanced
Installation
SKILL.md
Quick Reference
| Route Type | Folder Pattern | URL Example |
|---|---|---|
| Dynamic | [slug] |
/blog/hello → { slug: 'hello' } |
| Catch-all | [...slug] |
/docs/a/b → { slug: ['a', 'b'] } |
| Optional catch-all | [[...slug]] |
/shop or /shop/a/b |
| Route group | (name) |
No URL impact, layout grouping |
| Parallel route | @slot |
Independent loading/error |
| Intercept same level | (.)path |
Modal pattern |
| Private folder | _folder |
Not a route |
| Navigation | Code | Use Case |
|---|---|---|
| Link | <Link href="/path"> |
Declarative nav |
| router.push | router.push('/path') |
Programmatic nav |
| router.replace | router.replace('/path') |
No history entry |
| redirect | redirect('/path') |
Server redirect |