pub struct EuvButton { /* private fields */ }Expand description
Cross-platform interactive button component styled exclusively via ThemeTokens.
Implementations§
Source§impl EuvButton
Styling and click handler helpers for EuvButton.
impl EuvButton
Styling and click handler helpers for EuvButton.
Sourcepub fn variant(self, variant: EuvButtonVariant) -> Self
pub fn variant(self, variant: EuvButtonVariant) -> Self
Sourcepub fn size(self, size: EuvButtonSize) -> Self
pub fn size(self, size: EuvButtonSize) -> Self
Sourcepub fn destructive(self) -> Self
pub fn destructive(self) -> Self
Sourcepub fn state_colors(
variant: EuvButtonVariant,
palette: ThemePalette,
hovered: bool,
pressed: bool,
) -> (Option<Color>, Color, Option<Color>)
pub fn state_colors( variant: EuvButtonVariant, palette: ThemePalette, hovered: bool, pressed: bool, ) -> (Option<Color>, Color, Option<Color>)
Resolves (background, foreground, border_color) for a button variant and interaction state using contrast-safe SurfaceColors.
§Arguments
EuvButtonVariant- Visual emphasis variant.ThemePalette- Live theme palette.bool- Whether the button is hovered.bool- Whether the button is actively pressed.
§Returns
(Option<Color>, Color, Option<Color>)- Paired(background, foreground, border_color).
Sourcepub fn apply_state_paint(
paint: &mut PaintStyle,
variant: EuvButtonVariant,
tokens: ThemeTokens,
hovered: bool,
pressed: bool,
) -> Color
pub fn apply_state_paint( paint: &mut PaintStyle, variant: EuvButtonVariant, tokens: ThemeTokens, hovered: bool, pressed: bool, ) -> Color
Writes variant and interaction-state paint onto paint and returns the paired text color.
§Arguments
&mut PaintStyle- Target button paint style.EuvButtonVariant- Visual emphasis variant.ThemeTokens- Live theme tokens.bool- Whether the button is hovered.bool- Whether the button is actively pressed.
§Returns
Color- Contrast-paired foreground text color.
Sourcepub fn resolved_style_with_tokens(&self, tokens: ThemeTokens) -> Style
pub fn resolved_style_with_tokens(&self, tokens: ThemeTokens) -> Style
Sourcepub fn resolved_style(&self) -> Style
pub fn resolved_style(&self) -> Style
Source§impl EuvButton
impl EuvButton
pub fn get_label(&self) -> &String
pub fn get_mut_label(&mut self) -> &mut String
pub fn set_label(&mut self, val: String) -> &mut Self
pub fn get_variant(&self) -> EuvButtonVariant
pub fn get_mut_variant(&mut self) -> &mut EuvButtonVariant
pub fn set_variant(&mut self, val: EuvButtonVariant) -> &mut Self
pub fn get_size(&self) -> EuvButtonSize
pub fn get_mut_size(&mut self) -> &mut EuvButtonSize
pub fn set_size(&mut self, val: EuvButtonSize) -> &mut Self
pub fn get_disabled(&self) -> bool
pub fn get_mut_disabled(&mut self) -> &mut bool
pub fn set_disabled(&mut self, val: bool) -> &mut Self
pub fn get_fill(&self) -> bool
pub fn get_mut_fill(&mut self) -> &mut bool
pub fn set_fill(&mut self, val: bool) -> &mut Self
pub fn get_style(&self) -> Option<Style>
pub fn try_get_style(&self) -> Option<Style>
pub fn get_mut_style(&mut self) -> &mut Option<Style>
pub fn set_style(&mut self, val: Option<Style>) -> &mut Self
pub fn get_tokens(&self) -> ThemeTokens
pub fn get_mut_tokens(&mut self) -> &mut ThemeTokens
pub fn set_tokens(&mut self, val: ThemeTokens) -> &mut Self
pub fn get_mut_on_click(&mut self) -> &mut Option<UiEventHandler>
pub fn set_on_click(&mut self, val: Option<UiEventHandler>) -> &mut Self
Trait Implementations§
Source§impl Component for EuvButton
Implements impl #impl_generics ::euv::Component for #self_type #where_clause.
impl Component for EuvButton
Implements impl #impl_generics ::euv::Component for #self_type #where_clause.
Source§fn render(&self) -> NodeId
fn render(&self) -> NodeId
Renders EuvButton into the ambient framework-managed Context.
Variant backgrounds, borders, and paired foreground text colors are owned by a reactive Effect tracking
hover, press, and the live ambient theme so every interactive state preserves >= 4.5:1 contrast without
stale colors after theme switches.
§Arguments
&Self- Component descriptor reference.
§Returns
NodeId- Mounted root scene node handle.
Source§const NEEDS_LIFECYCLE: bool = false
const NEEDS_LIFECYCLE: bool = false
Rc<Self> observer registration on mount.Source§impl ComponentProps for EuvButton
Implements impl #impl_generics ::euv::ComponentProps for #struct_ident #ty_generics #where_clause.
impl ComponentProps for EuvButton
Implements impl #impl_generics ::euv::ComponentProps for #struct_ident #ty_generics #where_clause.
Source§fn init_props() -> Self
fn init_props() -> Self
Implements the init_props operation on Self.
Source§impl Lifecycle for EuvButton
Implements impl #impl_generics ::euv::Lifecycle for #self_type #where_clause.
impl Lifecycle for EuvButton
Implements impl #impl_generics ::euv::Lifecycle for #self_type #where_clause.
Source§fn retention_policy(&self) -> PageRetention
fn retention_policy(&self) -> PageRetention
Source§fn on_create(&self)
fn on_create(&self)
render pass executes. Read moreSource§fn on_update(&self, _node: NodeId)
fn on_update(&self, _node: NodeId)
Source§fn on_activate(&self, _node: NodeId)
fn on_activate(&self, _node: NodeId)
Source§fn on_freeze(&self, _node: NodeId)
fn on_freeze(&self, _node: NodeId)
PageRetention::Freeze. Read moreSource§fn on_resume(&self, _node: NodeId)
fn on_resume(&self, _node: NodeId)
Source§fn on_unmount(&self, _node: NodeId)
fn on_unmount(&self, _node: NodeId)
Source§fn on_destroy(&self)
fn on_destroy(&self)
Source§fn on_error(&self, _error: &str)
fn on_error(&self, _error: &str)
Source§fn on_appear(&self)
fn on_appear(&self)
Source§fn on_disappear(&self)
fn on_disappear(&self)
Source§fn on_foreground(&self)
fn on_foreground(&self)
Source§fn on_background(&self)
fn on_background(&self)
Source§fn on_inactive(&self)
fn on_inactive(&self)
Source§fn on_terminate(&self)
fn on_terminate(&self)
Source§fn on_system_event(&self, _event: &SystemEvent)
fn on_system_event(&self, _event: &SystemEvent)
SystemEvent delivered while this component is active. Read more