Skip to main content

euv_ui/component/drawer/view/
struct.rs

1use super::*;
2
3/// Props for the [`euv_drawer`] component.
4#[derive(Clone, CustomDebug, Default)]
5pub struct EuvDrawerProps {
6    /// The open state signal; the drawer slides in while set and clicking the
7    /// overlay closes it.
8    pub open: Signal<bool>,
9}
10
11/// Props for the [`euv_drawer_trigger`] component.
12///
13/// The trigger carries the state of the drawer so it can report the
14/// state to a reader and open the drawer when it is pressed.
15#[derive(Clone, CustomDebug, Default)]
16pub struct EuvDrawerTriggerProps {
17    /// Whether the drawer is open.
18    pub open: Signal<bool>,
19}
20
21/// Props for the [`euv_drawer_content`] component.
22///
23/// The panel carries the state of the drawer so it can report the state
24/// to a reader and hide itself while the drawer is closed.
25#[derive(Clone, CustomDebug, Default)]
26pub struct EuvDrawerContentProps {
27    /// Whether the drawer is open.
28    pub open: Signal<bool>,
29}
30
31/// Props for the [`euv_drawer_close`] component.
32///
33/// The close button carries the state of the drawer so it can close the
34/// drawer when it is pressed.
35#[derive(Clone, CustomDebug, Default)]
36pub struct EuvDrawerCloseProps {
37    /// Whether the drawer is open.
38    pub open: Signal<bool>,
39}
40
41/// Props for the [`euv_drawer_header`] component.
42///
43/// The header takes no settings of its own.
44#[derive(Clone, CustomDebug, Default)]
45pub struct EuvDrawerHeaderProps {}
46
47/// Props for the [`euv_drawer_footer`] component.
48///
49/// The footer takes no settings of its own.
50#[derive(Clone, CustomDebug, Default)]
51pub struct EuvDrawerFooterProps {}
52
53/// Props for the [`euv_drawer_title`] component.
54///
55/// The title takes no settings of its own.
56#[derive(Clone, CustomDebug, Default)]
57pub struct EuvDrawerTitleProps {}
58
59/// Props for the [`euv_drawer_description`] component.
60///
61/// The description takes no settings of its own.
62#[derive(Clone, CustomDebug, Default)]
63pub struct EuvDrawerDescriptionProps {}
64
65/// Props for the [`euv_drawer_overlay`] component.
66///
67/// The overlay dims the page behind the drawer. It carries the open state,
68/// so it can fade away together with the panel.
69#[derive(Clone, CustomDebug, Default)]
70pub struct EuvDrawerOverlayProps {
71    /// Whether the drawer is open.
72    pub open: Signal<bool>,
73}