wsimmonds avatar

Nextjs Dynamic Routes Params

Handles Next.js App Router dynamic routes where you need URL segments to drive what renders. The big thing here is it pushes you toward simple structures by default. Instead of jumping to app/products/[id] for product pages, it defaults to app/[id] unless the URL structure explicitly requires nesting. Also covers the Next.js 15 breaking change where params became a Promise, so you'll see the await params pattern throughout. Useful when you're building detail pages, blog posts, or anything that fetches data based on an identifier in the path. The route structure decision tree is genuinely helpful for avoiding over-engineered folder hierarchies.

skills.sh installs
304
GitHub stars
110
last updated
Aug 21, 2026

Install

$ npx -y skills add wsimmonds/claude-nextjs-skills --skill nextjs-dynamic-routes-params --agent claude-code

Installs into .claude/skills of the current project.

Files

Next.js Dynamic Routes and Pathname Parameters

When to Use This Skill

Use this skill when:

  • Creating dynamic route segments (e.g., blog/[slug], users/[id])
  • Accessing URL pathname parameters in Server or Client Components
  • Building pages that fetch data based on route parameters
  • Implementing catch-all or optional catch-all routes
  • Working with the params prop in page.tsx, layout.tsx, or route.ts

⚠️ RECOGNIZING WHEN YOU NEED DYNAMIC ROUTES

Look for requirements that tie data to the URL path.

Create a dynamic segment ([param]) whenever the UI depends on part of the pathname. Typical signals include:

  • Details pages that reference “the item’s ID/slug from the URL”
  • Copy that calls out path segments (e.g., /products/{id}, /blog/{slug})
  • Requirements to fetch data “based on whichever resource is being visited”
  • Navigation flows where one page links to /something/{identifier}

✅ Dynamic route response

Requirement: display product information based on whichever ID appears in the URL
Implementation: app/[id]/page.tsx
Access parameter with: const { id } = await params;

Sponsors

Details

Repository
github.com/wsimmonds/claude-nextjs-skills
Categories
Frontend Development, Documentation
First seen
Jun 3, 2026

More from wsimmonds/claude-nextjs-skills

All 9
1omedia avatardrupal-frontendomedia/drupal-skillDrupal Front End Specialist skill for theme development, Twig templates, and rendering system (Drupal 8-11+). Use when working with Drupal themes, Twig syntax, 300skills.sh installs
2pproenca avatarreact-native-elementspproenca/dot-skillsReact Native Elements UI component library best practices for performance, theming, and proper component usage. Use when building React Native apps with RNE, co258skills.sh installs
3thunderboltdev avatarshadcn-baseuithunderboltdev/shadcn-baseuiEnforces Base UI patterns in shadcn/ui projects. Prevents LLMs from incorrectly suggesting Radix UI patterns (asChild, etc.) when working with Base UI.251skills.sh installs
4existential-birds avatardagre-react-flowexistential-birds/beagleAutomatic graph layout using dagre with React Flow (@xyflow/react). Use when implementing auto-layout, hierarchical layouts, tree structures, or arranging nodes247skills.sh installs
5oguzhan18 avatarangular-cdkoguzhan18/angular-ecosystem-skillsALWAYS use when working with Angular CDK (Component Dev Kit), building custom accessible components, or using drag-drop, overlay, portal, or virtual scrolling.201skills.sh installs
6oguzhan18 avatarangular-componentsoguzhan18/angular-ecosystem-skillsALWAYS use when working with Angular Components, component architecture, @Component decorator, inputs, outputs, or component design patterns.182skills.sh installs