Shiny entrance inside sweetness

I just found out the sweetalertR package which allows you to create a really nice alert box.

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

It would be best to do any ui inside the alert, but I don't know if this is possible or not.

It seems like sweetalert () has 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 the server on the login inside the alert.

Apparently it is not being written by default in brilliant "input" (commented lines is a check)

Any idea?

+3


source to share





All Articles