# NOT RUN {
if (interactive()) {
library("shiny")
library("shinyWidgets")
ui <- fluidPage(
tags$h1("Confirm sweet alert"),
actionButton(inputId = "go", label = "Launch input text dialog"),
verbatimTextOutput(outputId = "res")
)
server <- function(input, output, session) {
observeEvent(input$go, {
inputSweetAlert(
session = session, inputId = "mytext",
title = "What's your name ?"
)
})
output$res <- renderPrint(input$mytext)
}
shinyApp(ui = ui, server = server)
}
# }
Run the code above in your browser using DataLab