Registry / web-framework / yew-router

yew-router

JSON →
library0.20.0rscratesunverified

A router implementation for the Yew web framework.

# Cargo.toml [dependencies] yew-router = "0.20.0"
INSTALL
IMPORT
SIG · YEW-ROUTER
Y
yew-router
web-frameworkrustv0.20.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Switch
use yew_router::prelude::*;

Sets up a basic Yew application with client-side routing.

use yew::prelude::*; use yew_router::prelude::*; #[derive(Clone, Routable, PartialEq)] enum Route { #[at("/")] Home, #[at("/about")] About, } fn switch(routes: Route) -> Html { match routes { Route::Home => html! { <h1>{"Home"}</h1> }, Route::About => html! { <h1>{"About"}</h1> }, } } #[function_component(App)] fn app() -> Html { html! { <BrowserRouter> <Switch<Route> render={switch} /> </BrowserRouter> } }
Debug
Known issues
gotchaRequires Yew framework and its associated features (e.g., wasm-bindgen).
fix
Ensure yew and yew-router are added to Cargo.toml with appropriate features.
affects: >=0.19.0
Upgrade
Version history
0.20.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources
yew-router — cargo add yew-router · libregistry