Debian Codegraph @

man/textOutput.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/bootstrap.R
3 \name{textOutput}
4 \alias{textOutput}
5 \alias{verbatimTextOutput}
6 \title{Create a text output element}
7 \usage{
8 textOutput(outputId, container = if (inline) span else div, inline = FALSE)
9
10 verbatimTextOutput(outputId, placeholder = FALSE)
11 }
12 \arguments{
13 \item{outputId}{output variable to read the value from}
14
15 \item{container}{a function to generate an HTML element to contain the text}
16
17 \item{inline}{use an inline (\code{span()}) or block container (\code{div()})
18 for the output}
19
20 \item{placeholder}{if the output is empty or \code{NULL}, should an empty
21 rectangle be displayed to serve as a placeholder? (does not affect
22 behavior when the output is nonempty)}
23 }
24 \value{
25 An output element for use in UI.
26 }
27 \description{
28 Render a reactive output variable as text within an application page.
29 \code{textOutput()} is usually paired with \code{\link[=renderText]{renderText()}} and puts regular text
30 in \verb{<div>} or \verb{<span>}; \code{verbatimTextOutput()} is usually paired with
31 \code{\link[=renderPrint]{renderPrint()}} and provides fixed-width text in a \verb{<pre>}.
32 }
33 \details{
34 In both functions, text is HTML-escaped prior to rendering.
35 }
36 \examples{
37 ## Only run this example in interactive R sessions
38 if (interactive()) {
39 shinyApp(
40 ui = basicPage(
41 textInput("txt", "Enter the text to display below:"),
42 textOutput("text"),
43 verbatimTextOutput("verb")
44 ),
45 server = function(input, output) {
46 output$text <- renderText({ input$txt })
47 output$verb <- renderText({ input$txt })
48 }
49 )
50 }
51 }