pub struct Alert { /* private fields */ }Expand description
A message that stands out: information, a success, a warning, an error.
let a = Alert![color = Color::Success, title = "Saved", "Your changes are live."];
let html = render_static(a);
assert!(html.contains(r#"<div class="nr-alert nr-alert-flat nr-c-success" role="status">"#));Implementations§
Source§impl Alert
impl Alert
pub fn new() -> Self
Sourcepub fn class(self, v: impl Into<String>) -> Self
pub fn class(self, v: impl Into<String>) -> Self
Extra classes for the outer element. They win over the defaults.
Sourcepub fn with(self, part: impl Part) -> Self
pub fn with(self, part: impl Part) -> Self
Add an attribute (class(..), id(..), aria(..), …) or a child.
pub fn color(self, v: Color) -> Self
Sourcepub fn variant(self, v: Variant) -> Self
pub fn variant(self, v: Variant) -> Self
Solid, Flat (default), Bordered or Faded; others render as Flat.
pub fn radius(self, v: Radius) -> Self
pub fn hide_icon(self, v: bool) -> Self
Sourcepub fn closable(self, v: bool) -> Self
pub fn closable(self, v: bool) -> Self
A close button; the component script removes the alert on click.
Sourcepub fn end_content(self, v: impl View) -> Self
pub fn end_content(self, v: impl View) -> Self
Something at the end: a button, a link.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Alert
impl !Sync for Alert
impl !UnwindSafe for Alert
impl Forget for Alert
impl Freeze for Alert
impl Move for Alert
impl Send for Alert
impl Unpin for Alert
impl UnsafeUnpin for Alert
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more