Use an alert element to let the user know of successes or to call attention to problems.

alert(..., dismissible = TRUE, fade = TRUE)

Arguments

...

Character strings specifying the text of the alert or additional named arguments passed as HTML attributes to the alert element.

dismissible

One of TRUE or FALSE specifying if the alert may be dismissed by the user, defaults to TRUE.

fade

One of TRUE or FALSE specifying if the alert fades out or immediately disappears when dismissed, defaults to TRUE.

See also

Other components: badge(), blockquote(), card(), collapsePane(), d1(), dropdown(), img(), jumbotron(), modal(), navContent(), popover(), pre(), toast()

Examples

### Default alert alert("Donec at pede.") %>% background("blue")
#> <div class="alert alert-dismissible fade show alert-blue" role="alert"> #> Donec at pede. #> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> #> <span aria-hidden="true">&times;</span> #> </button> #> </div>
### A more complex alert alert( h4("Etiam vel tortor sodales"), hr(), p("Fusce commodo.") ) %>% background("amber")
#> <div class="alert alert-dismissible fade show alert-amber" role="alert"> #> <h4 class="alert-heading">Etiam vel tortor sodales</h4> #> <hr/> #> <p>Fusce commodo.</p> #> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> #> <span aria-hidden="true">&times;</span> #> </button> #> </div>