pub struct AlertProps {
pub type: AlertType,
pub message: Element,
pub description: Option<Element>,
pub show_icon: bool,
pub closable: bool,
pub on_close: Option<EventHandler<()>>,
pub icon: Option<Element>,
pub banner: bool,
pub class: Option<String>,
pub style: Option<String>,
}Expand description
Props for the Alert component (MVP subset).
Fields§
§type: AlertTypeSemantic type of the alert, controlling colors and default icon.
message: ElementMain message content.
description: Option<Element>Optional detailed description.
show_icon: boolWhether to show the semantic icon.
closable: boolWhether the alert can be closed.
on_close: Option<EventHandler<()>>Called when the close button is clicked.
icon: Option<Element>Optional custom icon element.
Whether the alert should be rendered as a banner (full width, compact).
class: Option<String>Extra class on the root element.
style: Option<String>Inline style on the root element.
Implementations§
Source§impl AlertProps
impl AlertProps
Sourcepub fn builder() -> AlertPropsBuilder<((), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> AlertPropsBuilder<((), (), (), (), (), (), (), (), (), ())>
Create a builder for building AlertProps.
On the builder, call .r#type(...)(optional), .message(...), .description(...)(optional), .show_icon(...)(optional), .closable(...)(optional), .on_close(...)(optional), .icon(...)(optional), .banner(...)(optional), .class(...)(optional), .style(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of AlertProps.
Trait Implementations§
Source§impl Clone for AlertProps
impl Clone for AlertProps
Source§fn clone(&self) -> AlertProps
fn clone(&self) -> AlertProps
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more