pub struct ButtonProps {
pub variant: ButtonVariant,
pub size: ButtonSize,
pub block: bool,
pub availability: Availability,
pub busy: bool,
pub pressed: Option<bool>,
pub type: ButtonType,
pub icon_label: Option<AccessibleName>,
pub onclick: Option<EventHandler<MouseEvent>>,
pub class: Option<String>,
pub attributes: Vec<Attribute>,
pub children: Element,
}Expand description
Props for a native button with protected activation state.
Fields§
§variant: ButtonVariantVisual style.
size: ButtonSizeTarget size.
block: boolFill the container width.
availability: AvailabilityWhether activation is possible.
busy: boolRetain the label, show a spinner, and prevent duplicate activation.
pressed: Option<bool>Optional toggle state.
type: ButtonTypeForm behavior.
icon_label: Option<AccessibleName>Select icon-only layout with a required accessible name.
onclick: Option<EventHandler<MouseEvent>>Native activation event, guarded for unavailable and busy states.
class: Option<String>Extra classes.
attributes: Vec<Attribute>Consumer native attributes, before owned semantics.
children: ElementVisible label or decorative icon in icon-only mode.
Implementations§
Source§impl ButtonProps
impl ButtonProps
Sourcepub fn builder() -> ButtonPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> ButtonPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building ButtonProps.
On the builder, call .variant(...)(optional), .size(...)(optional), .block(...)(optional), .availability(...)(optional), .busy(...)(optional), .pressed(...)(optional), .r#type(...)(optional), .icon_label(...)(optional), .onclick(...)(optional), .class(...)(optional), .attributes(...)(optional), .children(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of ButtonProps.