Skip to main content

euv_ui/component/empty/view/
struct.rs

1use super::*;
2
3/// Props for the [`euv_empty`] component.
4///
5/// Defines the strongly-typed interface for an empty state: the glyph
6/// that marks the emptiness, the headline, the explanation, and an
7/// optional action that offers the reader a way out of it.
8#[derive(Clone, CustomDebug, Default)]
9pub struct EuvEmptyProps {
10    /// The optional glyph shown above the headline (skipped when empty).
11    pub icon: ::euv::CowText,
12    /// The headline naming what is missing.
13    pub title: ::euv::CowText,
14    /// The optional explanation under the headline (skipped when empty).
15    pub desc: ::euv::CowText,
16    /// The optional action label (skipped when empty).
17    pub action_label: ::euv::CowText,
18    /// The callback fired when the action is taken.
19    #[debug(skip)]
20    pub on_action: Option<Rc<dyn Fn(Event)>>,
21}
22
23/// Props for the [`euv_empty_header`] component.
24///
25/// The header takes no settings of its own.
26#[derive(Clone, CustomDebug, Default)]
27pub struct EuvEmptyHeaderProps {}
28
29/// Props for the [`euv_empty_media`] component.
30///
31/// The media carries the picture that marks the emptiness and the size
32/// the picture is drawn at.
33#[derive(Clone, CustomDebug, Default)]
34pub struct EuvEmptyMediaProps {
35    /// The size the picture is drawn at.
36    pub variant: EuvEmptyMediaVariant,
37}
38
39/// Props for the [`euv_empty_title`] component.
40///
41/// The title takes no settings of its own.
42#[derive(Clone, CustomDebug, Default)]
43pub struct EuvEmptyTitleProps {}
44
45/// Props for the [`euv_empty_description`] component.
46///
47/// The description takes no settings of its own.
48#[derive(Clone, CustomDebug, Default)]
49pub struct EuvEmptyDescriptionProps {}
50
51/// Props for the [`euv_empty_content`] component.
52///
53/// The content takes no settings of its own.
54#[derive(Clone, CustomDebug, Default)]
55pub struct EuvEmptyContentProps {}