Route params.
Data loaded by a route.
A router context.
Optional
componentA component that is rendered by a route.
If both component and lazyComponent are omitted then a route implicitly renders an Outlet.
Optional
dataA callback that loads data required to render a route.
Loaded data is available in route component via useRoute().data.
Loader options.
Optional
errorA component that is rendered when an error was thrown during route rendering.
Routes without an errorComponent don't have an error boundary.
Optional
isIf true
then pathname is matched in a case-sensitive manner.
Optional
lazyA lazy-loaded component that is rendered by a route. A component cached forever if a returned Promise is fulfilled.
Optional
loadingWhat to render when lazyComponent or dataLoader are being loaded.
If not specified then RouterOptions.loadingAppearance is used instead.
Optional
loadingA component that is rendered when a lazyComponent or a dataLoader are being loaded. Render a skeleton or a spinner in this component to notify user that a new route is being loaded.
Routes without a loadingComponent suspend a parent route.
Optional
notA component that is rendered if notFound was called during route loading or rendering or if there's no route that matches the location a router was navigated to.
Routes without notFoundComponent propagate notFound to a parent route.
Optional
paramsAn adapter that can validate and transform params extracted from the Location.pathname and Location.searchParams.
Params are available in route all components via useRoute().params.
Validates and transforms params extracted from a Location.pathname and Location.searchParams.
A dictionary that contains both pathname and search params.
Route params.
Optional
pathnameA URL pathname pattern.
Pattern can include params that conform :[A-Za-z$_][A-Za-z0-9$_]+
. For example "/:userId"
.
Params match a whole segment and cannot be partial. For example, "/teams--:teamId"
is invalid and would throw
a SyntaxError, while "/teams/:teamId"
is valid.
By default, a param matches a non-empty pathname segment. To make a param optional (so it can match an absent
segment) follow it by a ?
flag. For example: "/user/:userId?"
matches both "/user"
and "/user/37"
.
Static pathname segments can be optional as well: "/project/task?/:taskId"
.
By default, a param matches a single pathname segment. Follow a param with a *
flag to make it match multiple
segments. For example: "/:slug*"
matches "/watch"
and "/watch/a/movie"
. Such params are called wildcard
params.
To make param both wildcard and optional, combine *
and ?
flags: "/:slug*?"
.
To use :
as a character in a pathname pattern, replace it with an encoded
representation: %3A
.
Optional
renderingWhere the route is rendered.
If not specified then RouterOptions.renderingDisposition is used instead.
Options of a Route.