[][src]Crate yew_route_breadcrumbs

This crate is intended to be used with yew-router though it is not required to build this library.

The BreadCrumbs derive macro is the main way to interact with this crate. It derives a BreadCrumbs implementation block and a single breadcrumbs helper function of the same type as the BreadCrumbs trait.

It gives access to 2 attribute macros.

The breadcrumb attribute is used to create a breadcrumb. It expects the first argument to be a string literal that will be used as the breadcrumb text. The route argument can be used to set the breadcrumb route.

The breadcrumbs attribute is used to mark the field as nested. This only functions on structs with a single unnamed field.

use yew_route_breadcrumbs::BreadCrumbs;

enum AppRoutes {
    Blog, // Global1 > Blog

enum AdminRoutes {
    #[breadcrumb("Users", route = "/admin/users")]
    Users, // Global1 > Admin > Users
    Roles // Global1 > Admin > Roles

enum AuthRoutes {
    #[breadcrumb("Login", route = "/auth/login")]
    Login, // Global1 > Auth > Login
    Register // Global1 > Auth > Register



A single UI BreadCrumb. A Vector of Crumbs can be used to render the route position in the UI.



Helper trait used by the library

Derive Macros