shiny.ui.output_text#

shiny.ui.output_text(id, inline=False, container=None)#

Create a output container for some text.

Parameters
  • id (str) – An input id.

  • inline (bool) – If True, the result is displayed inline

  • container (Optional[TagFunction]) – A Callable that returns the output container.

Return type

A UI element

Note

Text is HTML-escaped prior to rendering.

Example

#| standalone: true
#| components: [editor, viewer]
#| layout: vertical
#| viewerHeight: 400
from shiny import *

app_ui = ui.page_fluid(
    ui.input_text("txt", "Enter the text to display below:"),
    ui.row(
        ui.column(6, ui.output_text("text")),
        ui.column(6, ui.output_text_verbatim("verb", placeholder=True)),
    ),
)

def server(input: Inputs, output: Outputs, session: Session):
    @output
    @render.text
    def text():
        return input.txt()

    @output
    @render.text
    def verb():
        return input.txt()


app = App(app_ui, server)