# 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"
)
})
}
)
}
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab