alert | R Documentation |
Use an alert element to let the user know of successes or to call attention to problems.
alert(..., dismissible = TRUE, fade = TRUE)
... |
Character strings specifying the text of the alert or additional named arguments passed as HTML attributes to the alert element. |
dismissible |
One of |
fade |
One of |
With dismissible = TRUE
you can allow the user to remove an alert. By
default, alerts are dismissible, well suited for one-time messages or
warnings.
alert( .style %>% background("primary"), "I'm around till you say goodbye" )
If you do want to keep an alert or control an alert with renderUI()
you can then use dismissible = FALSE
.
alert( .style %>% background("warning"), dismissible = FALSE, # <- "I'm calling attention to something, forever." )
Alerts include a few contextual variations. Links and headings are both styled differently inside an alert.
alert( .style %>% background("success"), h5("Success!"), "Your results can be found", a(href = "#", "here") )
If you want to avoid these automatic styles you can use tags$a
,
tags$h1
, tags$h2
, etc.
alert( .style %>% background("light") %>% border("dark"), tags$h6("Default heading"), h6("Alert heading"), hr(), tags$a(href = "#", "Default link"), a(href = "#", "Alert link") )
Like the a()
tag elements, yonder’s linkInput()
s also receive
contextual styling.
alert( .style %>% background("danger"), h5("Problem"), hr(), linkInput( id = "rerun", label = "Click to run again" ) )
Other components:
badge()
,
blockquote()
,
card()
,
collapsePane()
,
d1()
,
dropdown()
,
img()
,
jumbotron()
,
modal()
,
navContent()
,
popover()
,
pre()
,
toast()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.