renderUI: UI Output

Description Usage Arguments Details See Also Examples

View source: R/shinywrappers.R

Description

Experimental feature. Makes a reactive version of a function that generates HTML using the Shiny UI library.

Usage

1
renderUI(expr, env = parent.frame(), quoted = FALSE, outputArgs = list())

Arguments

expr

An expression that returns a Shiny tag object, HTML, or a list of such objects.

env

The environment in which to evaluate expr.

quoted

Is expr a quoted expression (with quote())? This is useful if you want to save an expression in a variable.

outputArgs

A list of arguments to be passed through to the implicit call to uiOutput when renderUI is used in an interactive R Markdown document.

Details

The corresponding HTML output tag should be div and have the CSS class name shiny-html-output (or use uiOutput).

See Also

conditionalPanel

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Only run examples in interactive R sessions
if (interactive()) {

ui <- fluidPage(
  uiOutput("moreControls")
)

server <- function(input, output) {
  output$moreControls <- renderUI({
    tagList(
      sliderInput("n", "N", 1, 1000, 500),
      textInput("label", "Label")
    )
  })
}
shinyApp(ui, server)
}

sheikhbarabas/shiny documentation built on May 29, 2019, 9:22 p.m.