3 releases
0.1.2 | Sep 24, 2020 |
---|---|
0.1.1 | Sep 5, 2020 |
0.1.0 | Sep 5, 2020 |
#6 in #breadcrumbs
Used in yew-route-breadcrumbs
8KB
149 lines
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
}
lib.rs
:
Procedural macro that generates UI breadcrumbs from nested enum's used as routes in yew router.
Dependencies
~1.5MB
~35K SLoC