File: textOutput.Rd

package info (click to toggle)
r-cran-shiny 1.10.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,948 kB
  • sloc: javascript: 39,934; sh: 28; makefile: 20
file content (51 lines) | stat: -rw-r--r-- 1,622 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bootstrap.R
\name{textOutput}
\alias{textOutput}
\alias{verbatimTextOutput}
\title{Create a text output element}
\usage{
textOutput(outputId, container = if (inline) span else div, inline = FALSE)

verbatimTextOutput(outputId, placeholder = FALSE)
}
\arguments{
\item{outputId}{output variable to read the value from}

\item{container}{a function to generate an HTML element to contain the text}

\item{inline}{use an inline (\code{span()}) or block container (\code{div()})
for the output}

\item{placeholder}{if the output is empty or \code{NULL}, should an empty
rectangle be displayed to serve as a placeholder? (does not affect
behavior when the output is nonempty)}
}
\value{
An output element for use in UI.
}
\description{
Render a reactive output variable as text within an application page.
\code{textOutput()} is usually paired with \code{\link[=renderText]{renderText()}} and puts regular text
in \verb{<div>} or \verb{<span>}; \code{verbatimTextOutput()} is usually paired with
\code{\link[=renderPrint]{renderPrint()}} and provides fixed-width text in a \verb{<pre>}.
}
\details{
In both functions, text is HTML-escaped prior to rendering.
}
\examples{
## 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 })
    }
  )
}
}