pub struct ButtonProps {Show 15 fields
pub class: Class,
pub selected_class: Class,
pub color: SharedString,
pub theme: SharedString,
pub size: SharedString,
pub state: SharedString,
pub title: SharedString,
pub responsive: bool,
pub fullwidth: bool,
pub outlined: bool,
pub inverted: bool,
pub rounded: bool,
pub disabled: bool,
pub selected: bool,
pub on_click: Option<EventHandler<MouseEvent>>,
/* private fields */
}
Expand description
The Button
properties struct for the configuration of the component.
Fields§
§class: Class
The class attribute for the component.
selected_class: Class
A class to apply to the component if the button is selected.
color: SharedString
The color of the button: white
| light
| dark
| black
| text
| ghost
| primary
| link
| info
| success
| warning
| danger
.
theme: SharedString
The theme of the button: light
| dark
.
size: SharedString
The size of the button: small
| normal
| medium
| large
.
state: SharedString
The state of the button: hover
| focus
| active
| loading
| static
.
title: SharedString
A title for the button.
responsive: bool
A flag to determine whether the button size is responsive or not.
fullwidth: bool
A flag to determine whether the button is a fullwidth block or not.
outlined: bool
A flag to determine whether the button has an outline or not.
inverted: bool
A flag to determine whether the button color is inverted or not.
rounded: bool
A flag to determine whether the button is rounded or not.
disabled: bool
A flag to determine whether the button is disabled or not.
selected: bool
A flag to determine whether the button is selected or not.
on_click: Option<EventHandler<MouseEvent>>
An event handler to be called when the button is clicked.
Implementations§
Source§impl ButtonProps
impl ButtonProps
Sourcepub fn builder() -> ButtonPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> ButtonPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building ButtonProps
.
On the builder, call .class(...)
(optional), .selected_class(...)
(optional), .color(...)
(optional), .theme(...)
(optional), .size(...)
(optional), .state(...)
(optional), .title(...)
(optional), .responsive(...)
(optional), .fullwidth(...)
(optional), .outlined(...)
(optional), .inverted(...)
(optional), .rounded(...)
(optional), .disabled(...)
(optional), .selected(...)
(optional), .on_click(...)
(optional), .children(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of ButtonProps
.
Trait Implementations§
Source§impl Clone for ButtonProps
impl Clone for ButtonProps
Source§fn clone(&self) -> ButtonProps
fn clone(&self) -> ButtonProps
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more