Function leptos_router::Router

source ·
pub fn Router(props: RouterProps) -> impl IntoView
Expand description

Provides for client-side and server-side routing. This should usually be somewhere near the root of the application.

§Required Props

  • children: Children
    • The <Router/> should usually wrap your whole page. It can contain any elements, and should include a Routes component somewhere to define and display Routes.

§Optional Props

  • base: [&'static str]
    • The base URL for the router. Defaults to "".
  • fallback: [fn() -> View]
    • A fallback that should be shown if no route is matched.
  • set_is_routing: impl Into<SignalSetter<bool>>
    • A signal that will be set while the navigation process is underway.
  • trailing_slash: TrailingSlash
    • How trailing slashes should be handled in [Route] paths.
  • id: usize
    • A unique identifier for this router, allowing you to mount multiple Leptos apps with different routes from the same server.