Skip to contents

Replace UI Elements in teal UI objects

Usage

modify_title(x, title = "teal app", favicon = NULL)

modify_header(x, element = tags$p())

modify_footer(x, element = tags$p())

Arguments

x

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

title

(shiny.tag or character(1)) The new title to be used.

favicon

(character) The path for the icon for the title. The image/icon path can be remote or the static path accessible by shiny, like the www/. If the favicon is NULL the teal logo will be used as the favicon.

element

Replacement UI element (shiny tag or HTML)

Examples

app <- init(
  data = teal_data(IRIS = iris, MTCARS = mtcars),
  modules = modules(example_module())
) |>
  modify_title(title = "Custom title")

if (interactive()) {
  shinyApp(app$ui, app$server)
}
app <- init(
  data = teal_data(IRIS = iris),
  modules = modules(example_module())
) |>
  modify_header(element = tags$div(h3("Custom header")))

if (interactive()) {
  shinyApp(app$ui, app$server)
}
app <- init(
  data = teal_data(IRIS = iris),
  modules = modules(example_module())
) |>
  modify_footer(element = "Custom footer")

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