pub struct TagProps {
pub class: Class,
pub color: SharedString,
pub theme: SharedString,
pub size: SharedString,
pub hoverable: bool,
pub rounded: bool,
pub on_click: Option<EventHandler<MouseEvent>>,
/* private fields */
}
Expand description
The Tag
properties struct for the configuration of the component.
Fields§
§class: Class
The class attribute for the component.
color: SharedString
The color of the tag: white
| light
| dark
| black
| primary
| link
| info
| success
| warning
| danger
.
theme: SharedString
The theme of the tag: light
.
size: SharedString
The size of the tag: normal
| medium
| large
.
hoverable: bool
A flag to determine whether the tag is hoverable or not.
rounded: bool
A flag to determine whether the tag is rounded or not.
on_click: Option<EventHandler<MouseEvent>>
An event handler to be called when the tag is clicked.
Implementations§
Source§impl TagProps
impl TagProps
Sourcepub fn builder() -> TagPropsBuilder<((), (), (), (), (), (), (), ())>
pub fn builder() -> TagPropsBuilder<((), (), (), (), (), (), (), ())>
Create a builder for building TagProps
.
On the builder, call .class(...)
(optional), .color(...)
(optional), .theme(...)
(optional), .size(...)
(optional), .hoverable(...)
(optional), .rounded(...)
(optional), .on_click(...)
(optional), .children(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of TagProps
.