Description Usage Arguments Note Examples
Send a message from the server and launch a sweet alert in the UI.
1 2 3 4 | receiveSweetAlert(messageId)
sendSweetAlert(messageId, title = "Title", text = "Text", type = NULL,
html = FALSE)
|
messageId |
The sweet alert id. |
title |
Title of the alert |
text |
Text of the alert |
type |
Type of the alert : null, info, success, warning or error |
html |
Logical. Use HTML in the text |
Use receiveSweetAlert()
in the UI and sendSweetAlert()
in the server.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## Not run:
if (interactive()) {
shinyApp(
ui = fluidPage(
tags$h1("Click the button"),
actionButton(inputId = "success", label = "Launch a success sweet alert"),
receiveSweetAlert(messageId = "successSw")
),
server = function(input, output) {
observeEvent(input$success, {
sendSweetAlert(
messageId = "successSw", title = "Success !!", text = "All in order", type = "success"
)
})
}
)
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.