Skip to main content

euv_ui/component/nav/view/
struct.rs

1use crate::*;
2
3/// Props for the `euv_nav_item` component.
4///
5/// Defines the strongly-typed interface for a navigation item link.
6#[derive(Clone, CustomDebug, Default)]
7pub struct EuvNavItemProps {
8    pub route_signal: Signal<String>,
9    pub icon: &'static str,
10    pub label: &'static str,
11    pub target: &'static str,
12    #[debug(skip)]
13    pub on_click: Option<ClickEventHandler>,
14    pub class: Option<Css>,
15}
16
17/// Props for the `euv_mobile_nav_item` component.
18///
19/// Defines the strongly-typed interface for a mobile navigation item link
20/// that closes the drawer on navigation.
21#[derive(Clone, CustomDebug, Default)]
22pub struct EuvMobileNavItemProps {
23    pub route_signal: Signal<String>,
24    pub drawer_open: Signal<bool>,
25    pub icon: &'static str,
26    pub label: &'static str,
27    pub target: &'static str,
28    #[debug(skip)]
29    pub on_navigate: Option<NavEventCallback>,
30}
31
32/// Configuration for a navigation item.
33///
34/// Used with `EuvNavItemsProps` for declarative navigation configuration.
35#[derive(Clone, Debug, Default)]
36pub struct EuvNavItemConfig {
37    /// The emoji icon for the navigation item.
38    pub icon: &'static str,
39    /// The display label for the navigation item.
40    pub label: &'static str,
41    /// The target route path.
42    pub target: &'static str,
43}
44
45/// Props for the `euv_nav_items` component.
46///
47/// Defines the strongly-typed interface for a configurable navigation items list.
48#[derive(Clone, CustomDebug, Default)]
49pub struct EuvNavItemsProps {
50    pub route_signal: Signal<String>,
51    pub items: Vec<EuvNavItemConfig>,
52    pub drawer_open: Option<Signal<bool>>,
53    #[debug(skip)]
54    pub on_item_click: Option<NavItemClickCallback>,
55}