Skip to main content

euv_ui/component/hero/view/
struct.rs

1use super::*;
2
3/// One action button of the [`euv_hero`] component.
4#[derive(Clone, Copy, CustomDebug, Data, Default, New)]
5pub struct EuvHeroAction {
6    /// The button text.
7    #[get(type(copy))]
8    pub text: &'static str,
9    /// The target route or external URL.
10    #[get(type(copy))]
11    pub link: &'static str,
12    /// Whether this is the primary (solid) button style.
13    #[get(type(copy))]
14    pub primary: bool,
15}
16
17/// Props for the [`euv_hero`] component.
18#[derive(Clone, Copy, CustomDebug, Data, Default, New)]
19pub struct EuvHeroProps {
20    /// The main title.
21    #[get(type(copy))]
22    pub title: &'static str,
23    /// The tagline rendered under the title (skipped when empty).
24    #[get(type(copy))]
25    pub subtitle: &'static str,
26    /// The action buttons (skipped when empty).
27    #[get(type(copy))]
28    pub actions: &'static [EuvHeroAction],
29}
30
31/// Props of the [`euv_hero_action`] component.
32#[derive(Clone, Copy, CustomDebug, Default)]
33pub struct EuvHeroActionProps {
34    /// The hero action to render.
35    pub action: EuvHeroAction,
36}