textOutput

0th

Percentile

Create a text output element

Render a reactive output variable as text within an application page. textOutput() is usually paired with renderText() and puts regular text in <div> or <span>; verbatimTextOutput() is usually paired with renderPrint() and provudes fixed-width text in a <pre>.

Usage
textOutput(outputId, container = if (inline) span else div, inline = FALSE)

verbatimTextOutput(outputId, placeholder = FALSE)

Arguments
outputId

output variable to read the value from

container

a function to generate an HTML element to contain the text

inline

use an inline (span()) or block container (div()) for the output

placeholder

if the output is empty or NULL, should an empty rectangle be displayed to serve as a placeholder? (does not affect behavior when the the output in nonempty)

Details

In both funtions, text is HTML-escaped prior to rendering.

Value

A output element for use in UI.

Aliases
  • textOutput
  • verbatimTextOutput
Examples
# NOT RUN {
## Only run this example in interactive R sessions
if (interactive()) {
  shinyApp(
    ui = basicPage(
      textInput("txt", "Enter the text to display below:"),
      textOutput("text"),
      verbatimTextOutput("verb")
    ),
    server = function(input, output) {
      output$text <- renderText({ input$txt })
      output$verb <- renderText({ input$txt })
    }
  )
}
# }
Documentation reproduced from package shiny, version 1.5.0, License: GPL-3 | file LICENSE

Community examples

Looks like there are no examples yet.