pub fn alert_with<F>(color: Color, f: F) -> Element<Div>Expand description
Create an alert with custom content.
Allows adding child elements like links, headings, etc.
ยงExample
use ironhtml_bootstrap::{alerts::alert_with, Color};
use ironhtml_elements::{A, Strong};
let a = alert_with(Color::Info, |div| {
div.child::<Strong, _>(|s| s.text("Note: "))
.text("Check ")
.child::<A, _>(|a| a.class("alert-link").attr("href", "#").text("this link"))
});
assert!(a.render().contains("alert-info"));
assert!(a.render().contains("alert-link"));