Skip to main content

euv_ui/component/button/
struct.rs

1use super::*;
2
3/// Cross-platform interactive button component styled exclusively via `ThemeTokens`.
4#[derive(Clone, CustomDebug, Data, New, Props)]
5pub struct EuvButton {
6    /// Visible label string.
7    pub(crate) label: String,
8    /// Visual emphasis variant.
9    #[new(skip)]
10    #[get(type(copy))]
11    #[prop(custom)]
12    pub(crate) variant: EuvButtonVariant,
13    /// Control size preset.
14    #[new(skip)]
15    #[get(type(copy))]
16    #[prop(custom)]
17    pub(crate) size: EuvButtonSize,
18    /// Whether interaction is disabled.
19    #[new(skip)]
20    #[get(type(copy))]
21    #[prop(custom)]
22    pub(crate) disabled: bool,
23    /// Whether the button expands (`flex_grow: 1.0`) to fill available space in flex rows.
24    #[new(skip)]
25    #[get(type(copy))]
26    #[prop(custom)]
27    pub(crate) fill: bool,
28    /// Optional style overrides merged onto the resolved button style (`style: { min_width: ..., margin: ... }`).
29    #[new(skip)]
30    #[get(type(copy))]
31    pub(crate) style: Option<Style>,
32    /// Active theme token bundle.
33    #[get(type(copy))]
34    pub(crate) tokens: ThemeTokens,
35    /// Optional click event handler.
36    #[new(skip)]
37    #[debug(skip)]
38    #[get(skip)]
39    #[prop(custom)]
40    pub(crate) on_click: Option<UiEventHandler>,
41}