Table of Contents

Class RouteDefinition

Namespace
Velvet
Assembly
Velvet.Docs.dll

Route definition. Construction via the V.Route() DSL is recommended (it performs exclusivity validation). When constructed directly, specifying RedirectTo and Guard together throws during NavigateAsync.

public sealed class RouteDefinition
Inheritance
object
RouteDefinition

Properties

CaseSensitive

Whether this route's literal path segments match case-sensitively. Defaults to false (case-insensitive). Set true for a case-sensitive route.

Children

Nested child routes rendered into this route's Outlet.

Element

Function-type component to mount when this route matches. Pass a ComponentNode built via V.Component().

ErrorElement

Component shown when the Loader fails.

Guard

Dynamic redirect predicate. Returning null lets navigation continue; returning a non-null path redirects to it. Evaluated after Match and before Loader. RedirectTo and Guard cannot be specified together.

Loader

Async data loader run when this route matches; its result is read via UseLoaderData. See LoaderMode.

LoaderMode

How Loader is sequenced relative to the navigation commit. Defaults to Await.

Path

Route pattern matched against the URL, e.g. "users/:id" ("/" for the root, "" for an index route). Supports :param, optional :param?, and splat *.

RedirectTo

Static redirect target path. Dynamic parameters (such as :id) are not expanded. Use Guard for redirects that need parameters. RedirectTo and Guard cannot be specified together.

ScopeId

Identifier for the per-route DI scope created via IRouteScopeFactory; null for no scope.