Table of Contents

Class RouteDefinition

Namespace
Velvet
Assembly
Velvet.Docs.dll

A directly constructed route that combines RedirectTo and Guard throws System.InvalidOperationException when its redirect configuration is evaluated during navigation.

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

Returning null continues navigation; returning a path redirects. Runs after matching and before Blockers and Loaders.

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 without parameter interpolation. Use Guard to derive a target from matched parameters.

ScopeId

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