pub struct TagProps {
pub color: Option<TagColor>,
pub closable: bool,
pub on_close: Option<EventHandler<()>>,
pub checkable: bool,
pub checked: Option<bool>,
pub default_checked: Option<bool>,
pub on_change: Option<EventHandler<bool>>,
pub class: Option<String>,
pub style: Option<String>,
pub children: Element,
}Expand description
Props for the Tag component (MVP subset).
Fields§
§color: Option<TagColor>Preset color for the tag.
closable: boolWhether the tag can be closed.
on_close: Option<EventHandler<()>>Called when the close icon is clicked.
checkable: boolWhether the tag is checkable (togglable selection).
checked: Option<bool>Controlled checked state for checkable tags.
default_checked: Option<bool>Default checked state for uncontrolled checkable tags.
on_change: Option<EventHandler<bool>>Called when the checked state changes.
class: Option<String>Extra class for the tag.
style: Option<String>Inline style for the tag.
children: ElementTag content.
Implementations§
Source§impl TagProps
impl TagProps
Sourcepub fn builder() -> TagPropsBuilder<((), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> TagPropsBuilder<((), (), (), (), (), (), (), (), (), ())>
Create a builder for building TagProps.
On the builder, call .color(...)(optional), .closable(...)(optional), .on_close(...)(optional), .checkable(...)(optional), .checked(...)(optional), .default_checked(...)(optional), .on_change(...)(optional), .class(...)(optional), .style(...)(optional), .children(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of TagProps.