pub fn close_button() -> Element<Button>Expand description
Create a Bootstrap close button.
ยงExample
use ironhtml_bootstrap::close_button::close_button;
let btn = close_button();
assert!(btn.render().contains("btn-close"));Examples found in repository?
examples/bootstrap_docs.rs (line 689)
677fn close_button_section() -> Element<Section> {
678 Element::<Section>::new()
679 .attr("id", "close-button")
680 .class("mb-5")
681 .child::<H2, _>(|h| h.class("border-bottom pb-2").text("Close Button"))
682 .child::<P, _>(|p| {
683 p.class("lead")
684 .text("A generic close button for dismissing content like modals and alerts.")
685 })
686 .child::<H4, _>(|h| h.class("mt-4").text("Examples"))
687 .child::<Div, _>(|d| {
688 d.class("bd-example mb-3")
689 .child::<Button, _>(|_| close_button::close_button())
690 })
691 .child::<H4, _>(|h| h.class("mt-4").text("Disabled"))
692 .child::<Div, _>(|d| {
693 d.class("bd-example mb-3")
694 .child::<Button, _>(|_| close_button::close_button_disabled())
695 })
696 .child::<H4, _>(|h| h.class("mt-4").text("Dark Variant"))
697 .child::<Div, _>(|d| {
698 d.class("bd-example mb-3 bg-dark p-3")
699 .child::<Button, _>(|_| close_button::close_button_white())
700 })
701}