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/// One card of the [`euv_feature_grid`] component.
32#[derive(Clone, Copy, CustomDebug, Data, Default, New)]
33pub struct EuvFeature {
34    /// The feature icon (emoji, skipped when empty).
35    #[get(type(copy))]
36    pub icon: &'static str,
37    /// The feature title.
38    #[get(type(copy))]
39    pub title: &'static str,
40    /// The feature details.
41    #[get(type(copy))]
42    pub details: &'static str,
43}
44
45/// Props of the [`euv_hero_action`] component.
46#[derive(Clone, Copy, CustomDebug, Default)]
47pub struct EuvHeroActionProps {
48    /// The hero action to render.
49    pub action: EuvHeroAction,
50}
51
52/// Props for the [`euv_feature_grid`] component.
53#[derive(Clone, Copy, CustomDebug, Data, Default, New)]
54pub struct EuvFeatureGridProps {
55    /// The feature cards (skipped when empty).
56    #[get(type(copy))]
57    pub features: &'static [EuvFeature],
58}