Route
Defines a single route in the route tree.
Routes can be nested via children to create layout hierarchies.
A route with component and children acts as a layout route — its
component should call use_route_outlet to render the
matched child.
Parameters:
- path (str | None, default:
None) - Relative path segment. Supports dynamic segments (:name), optional segments (:name?), splats (:name*), and custom regex constraints (:name(\\d+)).Nonefor pathless layout routes. - index (bool, default:
False) - WhenTrue, this route matches when the parent path matches exactly (no further segments). Index routes must not havepathorchildren. - component (Callable | None, default:
None) - A@componentfunction to render when this route matches. - children (list[Route] | None, default:
None) - Nested child routes. - loader (Callable[..., Any] | None, default:
None) - Optional data loader function. Called with the matched params dict when the route matches. Result is available via use_route_loader_data. - outlet (bool, default:
False) - WhenTrueandmanage_views=True, this route acts as a layout that wraps its matched child via use_route_outlet within a single View, instead of each child becoming a separate View.
Properties
componentclass-attributeinstance-attribute
component: Callable | None = Noneindexclass-attributeinstance-attribute
index: bool = Falseloaderclass-attributeinstance-attribute
loader: Callable[..., Any] | None = Noneoutletclass-attributeinstance-attribute
outlet: bool = Falsepathclass-attributeinstance-attribute
path: str | None = None