add_landing_modal: Add a Landing Popup to 'teal' Application

View source: R/teal_modifiers.R

add_landing_modalR Documentation

Add a Landing Popup to teal Application

Description

Adds a landing popup to the teal app. This popup will be shown when the app starts. The dialog must be closed by the app user to proceed to the main application.

Usage

add_landing_modal(
  x,
  title = NULL,
  content = NULL,
  footer = modalButton("Accept"),
  ...
)

Arguments

x

(teal_app) A teal_app object created using the init function.

title

An optional title for the dialog.

content

(character(1), shiny.tag or shiny.tag.list) with the content of the popup.

footer

UI for footer. Use NULL for no footer.

...

Additional arguments to shiny::modalDialog().

Examples in Shinylive

example-1

Open in Shinylive

Examples

app <- init(
  data = teal_data(IRIS = iris, MTCARS = mtcars),
  modules = modules(example_module())
) |>
  add_landing_modal(
    title = "Welcome",
    content = "This is a landing popup.",
    buttons = modalButton("Accept")
  )

if (interactive()) {
  shinyApp(app$ui, app$server)
}

teal documentation built on April 3, 2025, 5:32 p.m.