inst/apps/114-modal-dialog/app.R

shinyApp(
  ui = basicPage(
    # Hide the cursor when focusing
    tags$head(tags$style(HTML("
      input {
        caret-color: transparent;
      }
    "))),
    # Make sure body height does not change when taking screenshots
    tags$style("body { min-height: 100vh; }"),
    actionButton("show", "Show modal dialog")
  ),
  server = function(input, output) {
    observeEvent(input$show, {
      showModal(modalDialog(
        title = "Important message",
        "This is an important message!",
        hr(),
        selectInput('selectizeInput', 'Selectize options', state.name, selectize=TRUE),
        easyClose = TRUE
      ))
    })
  }
)
rstudio/shinycoreci documentation built on April 11, 2025, 3:17 p.m.