Crates.io | yew-route-breadcrumbs |
lib.rs | yew-route-breadcrumbs |
version | 0.1.2 |
source | src |
created_at | 2020-09-05 19:25:53.049679 |
updated_at | 2020-09-24 08:17:30.854889 |
description | Procedural macro to generate UI breadcrumbs from nested enums |
homepage | |
repository | https://github.com/Bytebuddha/yew-route-breadcrumbs |
max_upload_size | |
id | 285193 |
size | 15,543 |
Small library for generating UI breadcrumbs from the nested enums used as routes in yew.
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
}