2022-03-02 22:57:00 +00:00
< div align = "center" >
< h1 > Dioxus Router< / h1 >
< / div >
2021-11-19 05:49:04 +00:00
2022-03-02 22:57:00 +00:00
< div align = "center" >
<!-- Crates version -->
< a href = "https://crates.io/crates/dioxus" >
< img src = "https://img.shields.io/crates/v/dioxus.svg?style=flat-square"
alt="Crates.io version" />
< / a >
<!-- Downloads -->
< a href = "https://crates.io/crates/dioxus" >
< img src = "https://img.shields.io/crates/d/dioxus.svg?style=flat-square"
alt="Download" />
< / a >
<!-- docs -->
< a href = "https://docs.rs/dioxus" >
< img src = "https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square"
alt="docs.rs docs" />
< / a >
<!-- CI -->
< a href = "https://github.com/jkelleyrtp/dioxus/actions" >
< img src = "https://github.com/dioxuslabs/dioxus/actions/workflows/main.yml/badge.svg"
alt="CI status" />
< / a >
<!-- Awesome -->
< a href = "https://github.com/dioxuslabs/awesome-dioxus" >
< img src = "https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt = "Awesome Page" / >
< / a >
<!-- Discord -->
< a href = "https://discord.gg/XgGxMSkvUM" >
< img src = "https://img.shields.io/discord/899851952891002890.svg?logo=discord&style=flat-square" alt = "Discord Link" / >
< / a >
< / div >
< div align = "center" >
< h3 >
< a href = "https://dioxuslabs.com" > Website < / a >
< span > | < / span >
< a href = "https://github.com/DioxusLabs/example-projects" > Examples < / a >
< span > | < / span >
2022-05-21 15:33:17 +00:00
< a href = "https://dioxuslabs.com/router" > Guide (Latest) < / a >
2022-03-02 22:57:00 +00:00
< span > | < / span >
2022-05-21 02:11:07 +00:00
< a href = "https://dioxuslabs.com/nightly/router" > Guide (Master) < / a >
2022-03-02 22:57:00 +00:00
< / h3 >
< / div >
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.
2021-11-19 05:49:04 +00:00
2022-03-03 04:03:10 +00:00
```rust, ignore
2022-01-05 05:27:22 +00:00
fn app() {
cx.render(rsx! {
2022-01-25 20:06:37 +00:00
Router {
2022-01-05 05:27:22 +00:00
Route { to: "/", Component {} },
Route { to: "/blog", Blog {} },
Route { to: "/blog/:id", BlogPost {} },
}
})
2021-11-19 05:49:04 +00:00
}
2022-01-05 05:27:22 +00:00
```
2021-11-19 05:49:04 +00:00
2022-03-02 22:57:00 +00:00
## Resources
2021-11-19 05:49:04 +00:00
2022-03-02 22:57:00 +00:00
- See the mdbook
- See the one-page brief
- See the guide on the doc site
- The crates.io API