alert | R Documentation |
Create an alert with various styles
alert(
...,
type = c("default", "standard"),
close = FALSE,
color = c("none", "primary", "secondary", "info", "success", "danger", "warning"),
outline = FALSE,
icon = NULL
)
... |
Content of the alert |
type |
Choose a style for the alert, choices include "default", "standard" |
close |
Allow alert to be closable, TRUE or FALSE |
color |
Color of the alert, choose between "none", "primary", "secondary", "info", "success", "danger", "warning" |
outline |
Include an outline and exclude background, TRUE or FALSE |
icon |
Include an icon to the left of the content |
HTML of an alert box to be inserted within a page
if (interactive()) {
card(
header = FALSE,
shiny::h2("Standard alert (closeable)"),
alert("EX1", type = "standard",
color = "primary"),
alert("EX2", type = "standard",
color = "secondary"),
alert("EX3", type = "standard",
color = "secondary", outline = TRUE),
alert("EX4", type = "standard",
color = "danger", outline = TRUE, close = TRUE),
alert("EX5", type = "standard",
close = TRUE),
alert("EX6", type = "standard",
color = "primary", icon = shiny::icon("info"))
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.