module_teal_with_splash: Add splash screen to 'teal' application

module_teal_with_splashR Documentation

Add splash screen to teal application

Description

[Stable]

Displays custom splash screen during initial delayed data loading.

Usage

ui_teal_with_splash(
  id,
  data,
  title = build_app_title(),
  header = tags$p(),
  footer = tags$p()
)

srv_teal_with_splash(id, data, modules, filter = teal_slices())

Arguments

id

(character(1)) module id

data

(teal_data or teal_data_module) For constructing the data object, refer to teal_data() and teal_data_module().

title

(shiny.tag or character(1)) The browser window title. Defaults to a title "teal app" with the icon of NEST. Can be created using the build_app_title() or by passing a valid shiny.tag which is a head tag with title and link tag.

header

(shiny.tag or character(1)) The header of the app.

footer

(shiny.tag or character(1)) The footer of the app.

modules

(teal_modules) object containing the output modules which will be displayed in the teal application. See modules() and module() for more details.

filter

(teal_slices) Specifies the initial filter using teal_slices().

Details

This module pauses app initialization pending delayed data loading. This is necessary because the filter panel and modules depend on the data to initialize.

teal_with_splash follows the shiny module convention. init() is a wrapper around this that assumes that teal it is the top-level module and cannot be embedded.

Note: It is no longer recommended to embed teal in shiny apps as a module. but rather use init to create a standalone application.

Value

Returns a reactive expression containing a teal_data object when data is loaded or NULL when it is not.

See Also

init()

Examples

teal_modules <- modules(example_module())
# Shiny app with modular integration of teal
ui <- fluidPage(
  ui_teal_with_splash(id = "app1", data = teal_data())
)

server <- function(input, output, session) {
  srv_teal_with_splash(
    id = "app1",
    data = teal_data(iris = iris),
    modules = teal_modules
  )
}

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


teal documentation built on May 29, 2024, 10:11 a.m.