From 11deaadb6d1f31c4f86ef9e43eb93a690092795e Mon Sep 17 00:00:00 2001 From: Stephen Holsenbeck Date: Fri, 18 Mar 2022 15:36:01 -0400 Subject: [PATCH] ## useful-items: Re-add `bs4Alert` --- R/useful-items.R | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/R/useful-items.R b/R/useful-items.R index b2f55b57..ef06751d 100644 --- a/R/useful-items.R +++ b/R/useful-items.R @@ -57,7 +57,16 @@ bs4Badge <- function(..., color, position = c("left", "right"), ) } +#' @title Bootstrap 4 Alert box +#' +#' @param style \code{(character)} Inline style parameters to add +#' @inherit bs4Dash::bs4Card params return +#' @export +bs4Alert <- function(..., status = "primary", style = NULL, id = NULL, width = 6) { + bs4Dash:::validateStatus(status) + shiny::tags$div(class = paste0("alert alert-",status), role = "alert", ..., style = paste0("margin: 6px 5px 6px 15px;", sapply(\(x) {ifelse(grepl(";$", x), x, paste0(x, ";"))}), id = id)) +} #' Bootstrap 4 accordion container