#[repr(C)]pub struct Button {
pub label: AzString,
pub image: OptionImageRef,
pub button_type: ButtonType,
pub container_style: CssPropertyWithConditionsVec,
pub label_style: CssPropertyWithConditionsVec,
pub image_style: CssPropertyWithConditionsVec,
pub on_click: OptionButtonOnClick,
}Fields§
§label: AzStringContent (image or text) of this button, centered by default
image: OptionImageRefOptional image that is displayed next to the label
The semantic type of this button (Primary, Success, Danger, etc.)
container_style: CssPropertyWithConditionsVecStyle for this button container
label_style: CssPropertyWithConditionsVecStyle of the label
image_style: CssPropertyWithConditionsVecStyle of the image
on_click: OptionButtonOnClickOptional: Function to call when the button is clicked
Implementations§
Source§impl Button
impl Button
pub fn create(label: AzString) -> Self
Sourcepub fn with_type(label: AzString, button_type: ButtonType) -> Self
pub fn with_type(label: AzString, button_type: ButtonType) -> Self
Create a button with a specific type (Primary, Success, Danger, etc.)
Set the button type and update styling accordingly
Builder method to set the button type
pub fn swap_with_default(&mut self) -> Self
pub fn set_image(&mut self, image: ImageRef)
pub fn set_on_click<C: Into<ButtonOnClickCallback>>( &mut self, data: RefAny, on_click: C, )
pub fn with_on_click<C: Into<ButtonOnClickCallback>>( self, data: RefAny, on_click: C, ) -> Self
pub fn dom(self) -> Dom
Trait Implementations§
Source§impl PartialOrd for Button
impl PartialOrd for Button
impl StructuralPartialEq for Button
Auto Trait Implementations§
impl Freeze for Button
impl RefUnwindSafe for Button
impl Send for Button
impl Sync for Button
impl Unpin for Button
impl UnsafeUnpin for Button
impl UnwindSafe for Button
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more