2 releases
0.1.2 | Sep 24, 2020 |
---|---|
0.1.0 | Sep 5, 2020 |
#3 in #breadcrumbs
7KB
yew-route-breadcrumbs
Small library for generating UI breadcrumbs from the nested enums used as routes in yew.
Example
use yew_route_breadcrumbs::BreadCrumbs;
#[derive(Debug, BreadCrumbs)]
pub enum AppRoutes {
Index,
#[breadcrumb("Contact")]
Contact, // Contact
#[breadcrumbs]
Admin(AdminRoutes)
}
#[derive(Debug, BreadCrumbs)]
#[breadcrumb("Admin", route = "/admin/")]
pub enum AdminRoutes {
#[breadcrumb("Dashboard")]
Dashboard, // Admin > Dashboard
#[breadcrumb("Users")]
Users, // Admin > Users
#[breadcrumb("Users", route = "/admin/users/")]
#[breadcrumb("Create")]
CreateUser // Admin > Users > Create
}
Dependencies
~1.5MB
~35K SLoC