Expand description

Dioxus Router

Dioxus Router is a first-party Router for all your Dioxus Apps. It provides a React-Router style interface that works anywhere: across the browser, SSR, and natively.

fn app() {
    cx.render(rsx! {
        Router {
            Route { to: "/", Component {} },
            Route { to: "/blog", Blog {} },
            Route { to: "/blog/:id", BlogPost {} },
        }
    })
}

Resources

  • See the mdbook
  • See the one-page brief
  • See the guide on the doc site
  • The crates.io API

Structs

Props for the Link component.

A route is a combination of window title, saved state, and a URL.

The props for the Router component.

A RouteContext is a context that is provided by Route components.

Props for the Route component.

An abstraction over the platform’s history API.

The props for the Router component.

A handle to the current location of the router.

Functions

A component that renders a link to a route.

If this component is rendered, it will redirect the user to the given route.

A component that conditionally renders children based on the current location.

A component that conditionally renders children based on the current location of the app.

This hook provides access to information about the current location in the context of a [Router]. If this function is called outside of a Router component it will panic.

This hook provides access to the RouterService for the app.

Type Definitions

A shared type for the RouterCore.