What problem does it solve?
Path parameters are dynamic URL segments that must be captured into named variables and used safely across routes. This skill provides clear guidance on defining dynamic segments ($paramName), catch-all splats ($), optional params ({-$paramName}), and prefix/suffix patterns ({$param}.ext), plus utilities like useParams, and params.parse/stringify to transform values while preserving type safety.
Core Features & Use Cases
- Capture dynamic segments using $paramName in route definitions to expose strongly typed values to loaders and components.
- Support Splat / Catch-All routes with $_splat for flexible path matching and routing.
- Use Optional Params with {-$paramName} to represent optional segments that may be undefined.
- Leverage Prefix / Suffix patterns like {/path-{$param}} and etc to model complex URL schemas.
- Access params in navigation and loaders with Route.useParams and the params helpers, including parsing and stringifying for type-safe transformations.
- Enable i18n locale patterns in routes via path params where appropriate.
Quick Start
Define a route with '/posts/$postId' and retrieve the dynamic postId using Route.useParams().