#' @export
alert <- function(..., variant = c("success", "info", "warning", "danger"), dismissable = FALSE) {
variant <- paste0("alert-", match.arg(variant))
button <- NULL
if (dismissable) {
button <- tags$button(
type = "button", class = "close",
`data-dismiss` = "alert", `aria-label` = "Close",
tags$span(`aria-hidden` = "true", shiny::HTML("×"))
)
}
shiny::div(
class = "alert",
class = variant,
role = "alert",
button,
...
)
}
#' @export
alertLink <- function(inputId, label, icon, ...) {
shiny::actionLink(inputId, label, icon, class = "alert-link", ...)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.