modalDialogUI.Rd
Contrary to modalDialog the function allows to define modal in UI application structure. The modal can be opened with `modalButtonUI` placed anywhere in the application.
modalDialogUI(
modalId,
...,
button = modalButtonUI(modalId, "Open Modal"),
title = NULL,
footer = shiny::modalButton("Dismiss"),
size = c("m", "s", "l", "xl"),
easyClose = FALSE,
fade = TRUE,
backdrop = TRUE
)
modalButtonUI(modalId, label, icon = NULL, width = NULL, ...)
Id of the modal.
Additional properties added to button.
Visible button placed in modal DOM structure, responsible for opening it. Set `NULL` to have no button included.
An optional title for the modal dialog.
UI for modal dialog footer.
of the modal dialog. Can be "s", "m" (default), "l" or "xl".
Set `TRUE` to enable closing modal with clicking outside it.
Should fade-in animation be turned on?
Set `FALSE` to turn on background covering area outside modal dialog.
Modal button label.
Modal button icon.
Button width.
Nested list of `shiny.tag` objects defining html structure of modal dialog, or single `shiny.tag` object in case of using `modalButtonUI` method.
if (interactive()) {
library(shiny)
shinyApp(
ui = fluidPage(
modalDialogUI("mdl", "Hello")
),
server = function(input, output, session) {}
)
library(shiny)
shinyApp(
ui = fluidPage(
modalDialogUI("mdl", "Hello", button = NULL),
hr(),
modalButtonUI("mdl", "Open Modal From Here")
),
server = function(input, output, session) {}
)
}