euv_ui/component/panel/view/struct.rs
1use super::*;
2
3/// The border treatment of the `euv_panel` component.
4///
5/// The monochrome design system expresses separation with borders rather than
6/// shadows or background fills, so the variant only chooses the border style.
7#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
8pub enum EuvPanelVariant {
9 /// No border, for panels already separated by surrounding whitespace.
10 #[default]
11 Plain,
12 /// A solid 1px border, for a strongly grouped section.
13 Bordered,
14 /// A dashed 1px border, for a loosely grouped section.
15 Dashed,
16}
17
18/// Props for the `euv_panel` component.
19///
20/// Defines the strongly-typed interface for the bordered section container.
21/// A panel is a superset of [`EuvCardProps`]: it adds a subtitle and a border
22/// variant. Children are the panel body, so a footer is passed as trailing
23/// children rather than as a prop.
24#[derive(Clone, CustomDebug, Default)]
25pub struct EuvPanelProps {
26 /// The panel title rendered in the header.
27 pub title: &'static str,
28 /// The optional subtitle rendered under the title. Skipped when empty.
29 pub subtitle: &'static str,
30 /// The border treatment of the panel.
31 pub variant: EuvPanelVariant,
32}