Shiny input inside a sweetalert

Viewed 925

I've just find out the package sweetalertR which allows to create really nice alert box.

I would like to use an alert to ask user to fill an input.

The best would be to render inside the alert any ui, but no idea if it is possible or not.

It seems that the sweetalert() comes with a default input option

library(shinyWidgets)
library(shiny)
library(sweetalertR)

shinyApp(
    ui = fluidPage(
         tags$h1("Click the button"),
         actionButton(inputId = "inputbutton", label = "Launch sweet alert input"),
         receiveSweetAlert(messageId = "inputmss") # ,
         # verbatimTextOutput("text")
         ),
    server = function(input, output) {
         observeEvent(input$inputbutton, {
             sendSweetAlert(
                 messageId = "inputmss", title = "Input", text = "Enter text:", type = "input"
             )
         })
         # output$text <- renderPrint({input})
         }
)

I don't know how to access in server to the input inside the alert.

It doesn't appear to be recorded by default in shiny "input" (commented lines are this check)

Any idea?

0 Answers
Related