pub struct NotificationProps {
pub class: Class,
pub close_class: Class,
pub color: SharedString,
pub theme: SharedString,
pub on_close: Option<EventHandler<MouseEvent>>,
pub hidden: bool,
pub duration: u64,
/* private fields */
}
Expand description
The Notification
properties struct for the configuration of the component.
Fields§
§class: Class
The class attribute for the component.
close_class: Class
A class to apply to the close
button element.
color: SharedString
The color of the notification: primary
| link
| info
| success
| warning
| danger
.
theme: SharedString
The theme of the notification: light
.
on_close: Option<EventHandler<MouseEvent>>
An event handler to be called when the close
button is clicked.
A flag to determine whether the notification is hidden or not.
duration: u64
A duration in milliseconds.
Implementations§
Source§impl NotificationProps
impl NotificationProps
Sourcepub fn builder() -> NotificationPropsBuilder<((), (), (), (), (), (), (), ())>
pub fn builder() -> NotificationPropsBuilder<((), (), (), (), (), (), (), ())>
Create a builder for building NotificationProps
.
On the builder, call .class(...)
(optional), .close_class(...)
(optional), .color(...)
(optional), .theme(...)
(optional), .on_close(...)
(optional), .hidden(...)
(optional), .duration(...)
(optional), .children(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of NotificationProps
.
Trait Implementations§
Source§impl Clone for NotificationProps
impl Clone for NotificationProps
Source§fn clone(&self) -> NotificationProps
fn clone(&self) -> NotificationProps
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more