Skip to contents

The dialog() component is used to temporarily display some information in a size-limited window in front of the regular app screen. It is used to prompt the user for an action or a confirmation. It interrupts the current app processing as it is the only focused UI element and the main screen is dimmed/blocked. The dialog combines concepts known from other technologies where the windows have names such as dialog box, dialog window, pop-up, pop-up window, alert box, or message box.

It works slightly differently than Shiny’s modal, see the example.

See the official documention for dialog, for all the correct props.

button("dialogOpen", "Open")
Open

dialog(
  "dialog", 
  `header-text` = "Dialog",
  htmltools::p("Some content"),
  button("dialogClose", "Close")
)

Some content

Close
observeEvent(input$dialogOpen, {
  dialog_open("dialog")
})

observeEvent(input$dialogClose, {
  dialog_close("dialog")
})