euv_ui/component/card/view/struct.rs
1use super::*;
2
3/// Props for the `euv_card` component.
4///
5/// Defines the strongly-typed interface for the card wrapper.
6#[derive(Clone, Data, Debug, Default, New)]
7pub struct EuvCardProps {
8 /// The card title displayed in the header.
9 pub title: ::euv::CowText,
10 /// The heading level the title is rendered at.
11 ///
12 /// The level is a setting of the component because the library cannot
13 /// know the outline of the page the card sits in: the same card is the
14 /// section of one page and the whole panel of another.
15 #[get(type(copy))]
16 pub level: Option<EuvHeadingLevel>,
17}
18
19/// Props for the `euv_card_header` component.
20///
21/// The header groups the title, the description and the action, so it
22/// takes no settings of its own.
23#[derive(Clone, CustomDebug, Default)]
24pub struct EuvCardHeaderProps {}
25
26/// Props for the `euv_card_title` component.
27///
28/// The title names the card; the text is the fallback used when the
29/// title is given no children.
30#[derive(Clone, CustomDebug, Data, Default, New)]
31pub struct EuvCardTitleProps {
32 /// The title text.
33 pub text: ::euv::CowText,
34 /// The heading level the title is rendered at.
35 ///
36 /// The level is a setting of the component because the library cannot
37 /// know the outline of the page the card sits in: the same card is the
38 /// section of one page and the whole panel of another.
39 #[get(type(copy))]
40 pub level: Option<EuvHeadingLevel>,
41}
42
43/// Props for the `euv_card_description` component.
44///
45/// The description explains the card; the text is the fallback used when
46/// the description is given no children.
47#[derive(Clone, CustomDebug, Data, Default, New)]
48pub struct EuvCardDescriptionProps {
49 /// The description text.
50 pub text: ::euv::CowText,
51}
52
53/// Props for the `euv_card_content` component.
54///
55/// The content holds the body of the card, so it takes no settings of
56/// its own.
57#[derive(Clone, CustomDebug, Default)]
58pub struct EuvCardContentProps {}
59
60/// Props for the `euv_card_footer` component.
61///
62/// The footer holds the closing row of the card, so it takes no settings
63/// of its own.
64#[derive(Clone, CustomDebug, Default)]
65pub struct EuvCardFooterProps {}
66
67/// Props for the `euv_card_action` component.
68///
69/// The action holds the control that acts on the card, so it takes no
70/// settings of its own.
71#[derive(Clone, CustomDebug, Default)]
72pub struct EuvCardActionProps {}