Skip to contents

[Stable] Module to create a teal app. This module can be called directly instead of init() and included in your custom application. Please note that init() adds reporter_previewer_module automatically, which is not a case when calling ui/srv_teal directly.

Usage

ui_teal(
  id,
  modules,
  title = build_app_title(),
  header = tags$p(),
  footer = tags$p()
)

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

Arguments

id

(character) Optionally, a string specifying the shiny module id in cases it is used as a shiny module rather than a standalone shiny app. This is a legacy feature.

modules

(list or teal_modules or teal_module) Nested list of teal_modules or teal_module objects or a single teal_modules or teal_module object. These are the specific output modules which will be displayed in the teal application. See modules() and module() for more details.

title

(shiny.tag or character(1)) Optionally, 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)) Optionally, the header of the app.

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

data

(teal_data, teal_data_module, or reactive returning teal_data) The data which application will depend on.

filter

(teal_slices) Optionally, specifies the initial filter using teal_slices().

Value

NULL invisibly

Details

Module is responsible for creating the main shiny app layout and initializing all the necessary components. This module establishes reactive connection between the input data and every other component in the app. Reactive change of the data passed as an argument, reloads the app and possibly keeps all input settings the same so the user can continue where one left off.

data flow in teal application

This module supports multiple data inputs but eventually, they are all converted to reactive returning teal_data in this module. On this reactive teal_data object several actions are performed:

Fallback on failure

teal is designed in such way that app will never crash if the error is introduced in any custom shiny module provided by app developer (e.g. teal_data_module(), teal_transform_module()). If any module returns a failing object, the app will halt the evaluation and display a warning message. App user should always have a chance to fix the improper input and continue without restarting the session.