router-core/path-params

Clarify dynamic path params in TanStack Router routes.

Updated Apr 1, 2026
One-click install
npx skills add https://github.com/cill-i-am/task-tracker --skill router-core-path-params-cill-i-am
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: router-core/path-params
Source: https://github.com/cill-i-am/task-tracker/tree/main/.agents/skills/tanstack-router-path-params
Command: npx skills add https://github.com/cill-i-am/task-tracker --skill router-core-path-params-cill-i-am

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers often struggle to design, read, and use dynamic URL path parameters in TanStack Router, including basic segments, optional parts, splat routes, and i18n-aware patterns, leading to inconsistent implementations and bugs.

Core Features & Use Cases

  • Define dynamic segments with $paramName and access them via Route.useParams() in components.
  • Support optional params using the {-$param} syntax and capture undefined values gracefully.
  • Handle splat routes with _splat for catch-all segments and use it in UI or data fetching.
  • Enable prefix/suffix patterns like {$param}.ext and combined forms for flexible routing.
  • Provide params.parse and params.stringify for bidirectional transformation and type-safe handling.
  • Integrate with i18n locale patterns to route across multiple locales.

Quick Start

Create a route file with a path that includes dynamic segments and optional parts, then access the values with Route.useParams() in your component.

Frequently Asked Questions about router-core/path-params

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use dynamic path params in TanStack Router?

Dynamic path params in TanStack Router are defined using the $paramName syntax in your route path and accessed within components via Route.useParams(), ensuring type-safe values for rendering and data fetching.

How do I define optional params in TanStack Router?

Optional params in TanStack Router are defined using the {-$param} syntax, allowing the router to match URLs with or without the segment and gracefully capture undefined values for component logic.

Does TanStack Router support splat routes for catch-all URL segments?

TanStack Router supports splat routes using the _splat pattern to catch-all URL segments, enabling you to use the captured value in UI rendering or data fetching for flexible routing.

What's the best way to handle i18n locale routing with dynamic path params?

Handling i18n locale routing with dynamic path params involves integrating locale patterns into your route definitions, allowing TanStack Router to correctly parse and navigate URLs across multiple locales.

Can I use params.parse and params.stringify for bidirectional URL transformation?

Yes, you can use params.parse and params.stringify in TanStack Router for bidirectional transformation, providing type-safe handling when converting between URL path segments and application state.

Why are my dynamic route segments not working with prefix and suffix patterns?

Dynamic route segments with prefix and suffix patterns like {$param}.ext require exact syntax configuration in TanStack Router; incorrect placement prevents proper URL matching and useParams value extraction.