Skip to main content

EuvButton

Struct EuvButton 

Source
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.

Source

pub fn on_click<F>(self, callback: F) -> Self
where F: FnMut(&UiEvent) + 'static,

Attaches a click callback invoked when the button is activated.

§Arguments
  • Self - Source button.
  • F - Click callback closure.
§Returns
  • Self - Updated button.
Source

pub fn variant(self, variant: EuvButtonVariant) -> Self

Sets the visual emphasis variant fluently.

§Arguments
  • Self - Source button.
  • EuvButtonVariant - Visual variant.
§Returns
  • Self - Updated button.
Source

pub fn size(self, size: EuvButtonSize) -> Self

Sets the control size tier fluently.

§Arguments
  • Self - Source button.
  • EuvButtonSize - Unified control size.
§Returns
  • Self - Updated button.
Source

pub fn secondary(self) -> Self

Applies the Secondary button variant fluently.

§Arguments
  • Self - Source button.
§Returns
  • Self - Secondary button.
Source

pub fn outline(self) -> Self

Applies the Outline button variant fluently.

§Arguments
  • Self - Source button.
§Returns
  • Self - Outline button.
Source

pub fn ghost(self) -> Self

Applies the Ghost button variant fluently.

§Arguments
  • Self - Source button.
§Returns
  • Self - Ghost button.
Source

pub fn destructive(self) -> Self

Applies the Destructive button variant fluently.

§Arguments
  • Self - Source button.
§Returns
  • Self - Destructive button.

Applies the Link button variant fluently.

§Arguments
  • Self - Source button.
§Returns
  • Self - Link button.
Source

pub fn sm(self) -> Self

Applies the Small unified control height fluently.

§Arguments
  • Self - Source button.
§Returns
  • Self - Small button.
Source

pub fn lg(self) -> Self

Applies the Large unified control height fluently.

§Arguments
  • Self - Source button.
§Returns
  • Self - Large button.
Source

pub fn icon(self) -> Self

Applies the square Icon control preset fluently.

§Arguments
  • Self - Source button.
§Returns
  • Self - Icon button.
Source

pub fn disabled(self, disabled: bool) -> Self

Sets the disabled interaction state fluently.

§Arguments
  • Self - Source button.
  • bool - Whether the button is disabled.
§Returns
  • Self - Updated button.
Source

pub fn fill(self, enabled: bool) -> Self

Enables or disables automatic flex stretching (flex_grow: 1.0) inside horizontal rows.

§Arguments
  • Self - Source button.
  • bool - Whether the button stretches to fill remaining row width.
§Returns
  • Self - Updated button.
Source

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).
Source

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.
Source

pub fn resolved_style_with_tokens(&self, tokens: ThemeTokens) -> Style

Resolves the deterministic compiled Style for this button under tokens.

§Arguments
  • &Self - Button configuration.
  • ThemeTokens - Active theme tokens.
§Returns
  • Style - Compiled cross-platform style.
Source

pub fn resolved_style(&self) -> Style

Resolves the deterministic compiled Style for this button.

§Arguments
  • &Self - Button configuration.
§Returns
  • Style - Compiled cross-platform style.
Source§

impl EuvButton

Source

pub fn get_label(&self) -> &String

Source

pub fn get_mut_label(&mut self) -> &mut String

Source

pub fn set_label(&mut self, val: String) -> &mut Self

Source

pub fn get_variant(&self) -> EuvButtonVariant

Source

pub fn get_mut_variant(&mut self) -> &mut EuvButtonVariant

Source

pub fn set_variant(&mut self, val: EuvButtonVariant) -> &mut Self

Source

pub fn get_size(&self) -> EuvButtonSize

Source

pub fn get_mut_size(&mut self) -> &mut EuvButtonSize

Source

pub fn set_size(&mut self, val: EuvButtonSize) -> &mut Self

Source

pub fn get_disabled(&self) -> bool

Source

pub fn get_mut_disabled(&mut self) -> &mut bool

Source

pub fn set_disabled(&mut self, val: bool) -> &mut Self

Source

pub fn get_fill(&self) -> bool

Source

pub fn get_mut_fill(&mut self) -> &mut bool

Source

pub fn set_fill(&mut self, val: bool) -> &mut Self

Source

pub fn get_style(&self) -> Option<Style>

Source

pub fn try_get_style(&self) -> Option<Style>

Source

pub fn get_mut_style(&mut self) -> &mut Option<Style>

Source

pub fn set_style(&mut self, val: Option<Style>) -> &mut Self

Source

pub fn get_tokens(&self) -> ThemeTokens

Source

pub fn get_mut_tokens(&mut self) -> &mut ThemeTokens

Source

pub fn set_tokens(&mut self, val: ThemeTokens) -> &mut Self

Source

pub fn get_mut_on_click(&mut self) -> &mut Option<UiEventHandler>

Source

pub fn set_on_click(&mut self, val: Option<UiEventHandler>) -> &mut Self

Source§

impl EuvButton

Source

pub fn new(label: String, tokens: ThemeTokens) -> Self

Source§

impl EuvButton

Implements impl #impl_generics #ident #ty_generics #where_clause.

Source

pub fn label<__EuvStr>(self, value: __EuvStr) -> Self
where __EuvStr: Into<String>,

Source

pub fn style<__EuvStyle>(self, value: __EuvStyle) -> Self
where __EuvStyle: Into<Option<Style>>,

Source

pub fn tokens(self, value: ThemeTokens) -> Self

Trait Implementations§

Source§

impl Clone for EuvButton

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Component for EuvButton

Implements impl #impl_generics ::euv::Component for #self_ty #where_clause.

Source§

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

Compile-time opt-in flag indicating whether this component overrides lifecycle hooks or retention policy and requires Rc<Self> observer registration on mount.
Source§

fn mount(self) -> NodeId

Mounts this component through the complete framework lifecycle (on_create -> render -> on_mount) and registers its Lifecycle observer on the mounted node. Read more
Source§

impl ComponentProps for EuvButton

Implements impl #impl_generics ::euv::ComponentProps for #ident #ty_generics #where_clause.

Source§

fn init_props() -> Self

Implements the init_props operation on Self.

Source§

impl Debug for EuvButton

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the struct fields as a debug struct, skipping excluded fields.

§Arguments
  • &mut ::std::fmt::Formatter<'_> - The formatter to write the representation into.
§Returns
  • ::std::fmt::Result - Success or failure of the formatting operation.
Source§

impl Lifecycle for EuvButton

Implements impl #impl_generics ::euv::Lifecycle for #self_ty #where_clause.

Source§

fn retention_policy(&self) -> PageRetention

Declares how the framework retains this page or component when navigating away. Read more
Source§

fn on_create(&self)

Invoked once immediately before the component’s initial render pass executes. Read more
Source§

fn on_mount(&self, _node: NodeId)

Invoked once immediately after render attaches the root NodeId to the scene tree. Read more
Source§

fn on_update(&self, _node: NodeId)

Invoked when external props, theme tokens, or cross-page state trigger a component update. Read more
Source§

fn on_activate(&self, _node: NodeId)

Invoked whenever this component or routed page becomes the active visible view. Read more
Source§

fn on_freeze(&self, _node: NodeId)

Invoked when the router or parent suspends this subtree under PageRetention::Freeze. Read more
Source§

fn on_resume(&self, _node: NodeId)

Invoked when a previously frozen subtree resumes and coalesced cross-page updates flush. Read more
Source§

fn on_unmount(&self, _node: NodeId)

Invoked immediately before the subtree is detached and its reactive scope is disposed. Read more
Source§

fn on_destroy(&self)

Invoked after the component’s reactive scope and child nodes have been fully destroyed. Read more
Source§

fn on_error(&self, _error: &str)

Invoked when an error boundary or runtime fault surfaces inside this component subtree. Read more
Source§

fn on_appear(&self)

Invoked when this component, routed page, or application window becomes visually presented. Read more
Source§

fn on_disappear(&self)

Invoked when this component, routed page, or application window ceases to be visually presented. Read more
Source§

fn on_foreground(&self)

Invoked when the application returns to active foreground execution. Read more
Source§

fn on_background(&self)

Invoked when the application enters suspended/hidden background execution. Read more
Source§

fn on_inactive(&self)

Invoked when the application enters inactive status (occluded, app switcher, or deactivated). Read more
Source§

fn on_terminate(&self)

Invoked when the application is terminating gracefully. Read more
Source§

fn on_system_event(&self, _event: &SystemEvent)

Invoked for every normalized cross-platform SystemEvent delivered while this component is active. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for EuvButton

§

impl !Send for EuvButton

§

impl !Sync for EuvButton

§

impl !UnwindSafe for EuvButton

§

impl Forget for EuvButton

§

impl Freeze for EuvButton
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, *const RcInner<RefCell<dyn FnMut(&UiEvent)>> is !null: Freeze, PhantomData<RcInner<RefCell<dyn FnMut(&UiEvent)>>>: Freeze,

§

impl Move for EuvButton

§

impl Unpin for EuvButton
where *const u8 is !null: Unpin, Rc<RefCell<dyn FnMut(&UiEvent)>>: Unpin,

§

impl UnsafeUnpin for EuvButton

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.