Defining Path Parameters
Path parameters are defined in route paths using special syntax:Required Parameters
Use$ prefix for required parameters:
Optional Parameters
Use{-$paramName} for optional parameters:
Wildcard Parameters
Use$ alone to capture everything:
_splat parameter.
Named Wildcards
Combine wildcards with names:Using Path Parameters
Access parameters in components withuseParams:
Type Safety
Specify the route for type-safe parameter access:Parameter Parsing
Transform string parameters into typed values:postId is a number instead of a string:
Validation During Parsing
Throw errors for invalid parameters:Parameters in Loaders
Access parameters in loader functions:Parameters in Navigation
Provide parameters when navigating:Using Links
Using Navigate
Allowed Characters
By default, path parameters are URL-encoded. Configure allowed characters:Multiple Parameters
Routes can have multiple parameters:Inherited Parameters
Child routes inherit parameters from parents:Parameter Validation
Use validators for type-safe parameter parsing:Accessing Raw Parameters
Access unparsed string parameters:Parameter Encoding
The router handles encoding automatically:Building URLs with Parameters
Build URLs programmatically:Skip Route on Parse Error
Skip routes when parameter parsing fails:- Routes with failed parsing are skipped during matching
- Router continues to find a matching route
- Useful for fallback behavior
Common Patterns
Numeric IDs
UUID Validation
Slugs
File Paths
Next Steps
Search Params
Work with URL search parameters
Loaders
Use parameters in data loading
Type Safety
Configure end-to-end type safety
Navigation
Navigate with path parameters