Method Navigate
- Namespace
- Velvet
- Assembly
- Velvet.Docs.dll
Navigate(string, bool, string?)
Declarative redirect element. Navigates to to via the active
Router, then renders nothing. Use it for conditional redirects such as
return loggedIn ? V.Outlet() : V.Navigate("/login").
public static ComponentNode Navigate(string to, bool replace = false, string? key = null)
Parameters
tostringNavigation target path (absolute or relative).
replaceboolWhen true, replaces the current history entry instead of pushing.
keystringKey used to disambiguate siblings at the same position.
Returns
- ComponentNode
A ComponentNode that performs the redirect and renders nothing.