#breadcrumbs #yew #wasm #proc-macro

yew-route-breadcrumbs

Procedural macro to generate UI breadcrumbs from nested enums

2 releases

0.1.2 Sep 24, 2020
0.1.0 Sep 5, 2020

#3 in #breadcrumbs

MIT license

7KB

yew-route-breadcrumbs

License: MIT Crates.io Docs.rs Build Status

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
~37K SLoC