yew-route-breadcrumbs

Crates.ioyew-route-breadcrumbs
lib.rsyew-route-breadcrumbs
version0.1.2
sourcesrc
created_at2020-09-05 19:25:53.049679
updated_at2020-09-24 08:17:30.854889
descriptionProcedural macro to generate UI breadcrumbs from nested enums
homepage
repositoryhttps://github.com/Bytebuddha/yew-route-breadcrumbs
max_upload_size
id285193
size15,543
Patrick Greene (bytebuddha)

documentation

https://docs.rs/yew-route-breadcrumbs

README

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
}
Commit count: 14

cargo fmt