Skip to contents

Server-side render function used to provide values for template items. Use named values matching the template variable names in the associated epoxyHTML(). When the values are updated by the app, renderEpoxyHTML() will update the values shown in the app's UI.

Usage

renderEpoxyHTML(..., .list = NULL, env = parent.frame(), outputArgs = list())

Arguments

...

Named values corresponding to the template variables created with the associated epoxyHTML() UI element.

.list

A named list or a shiny::reactiveValues() list with names corresponding to the template variables created with the associated epoxyHTML() UI element.

env

The environment in which to evaluate the ...

outputArgs

A list of arguments to be passed through to the implicit call to epoxyHTML() when renderEpoxyHTML is used in an interactive R Markdown document.

Value

A server-side Shiny render function that should be assigned to Shiny's output object and named to match the .id of the corresponding epoxyHTML() call.

See also

Examples

# This small app shows the current time using `epoxyHTML()`
# to provide the HTML template and `renderEpoxyHTML()` to
# update the current time every second.

ui <- shiny::fluidPage(
  shiny::h2("Current Time"),
  epoxyHTML(
    "time",
    shiny::p("The current time is {{strong time}}.")
  )
)

server <- function(input, output, session) {
  current_time <- shiny::reactive({
    shiny::invalidateLater(1000)
    strftime(Sys.time(), "%F %T")
  })

  output$time <- renderEpoxyHTML(time = current_time())
}

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