Skip to main content

euv_ui/component/breadcrumb/view/
struct.rs

1use super::*;
2
3/// One entry of the [`euv_breadcrumb`] trail.
4///
5/// Crumbs render in slice order from the root to the current page; the
6/// caller is responsible for ordering them that way.
7#[derive(Clone, Copy, CustomDebug, Data, Default, New)]
8pub struct EuvBreadcrumbItem {
9    /// The display text of this crumb.
10    #[get(type(copy))]
11    pub label: &'static str,
12    /// The link target of this crumb (ignored for the last entry, which
13    /// renders as the current page).
14    #[get(type(copy))]
15    pub href: &'static str,
16}
17
18/// Props for the [`euv_breadcrumb`] component.
19#[derive(Clone, CustomDebug, Default)]
20pub struct EuvBreadcrumbProps {
21    /// The trail entries, ordered from the root to the current page.
22    pub items: Vec<EuvBreadcrumbItem>,
23    /// The separator rendered between two crumbs.
24    pub separator: &'static str,
25}