| inputSweetAlert {shinyWidgets} | R Documentation |
Launch a popup with a text input
inputSweetAlert(session, inputId, title = NULL, text = NULL, type = NULL, btn_labels = "Ok", placeholder = NULL)
session |
The |
inputId |
The |
title |
Title of the alert. |
text |
Text of the alert. |
type |
Type of the alert : info, success, warning or error. |
btn_labels |
Labels for button(s). |
placeholder |
A character string giving the user a hint as to what can be entered into the control. |
sendSweetAlert, confirmSweetAlert
## 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)
}
## End(Not run)