ui.output_text_verbatim

ui.output_text_verbatim(id, placeholder=False)

Create a output container for some text.

Place a text result in the user interface. Differs from output_text in that it wraps the text in a fixed-width container with a gray-ish background color and border.

Parameters

id: str

An output id.

placeholder: bool = False

If the output is empty or None, should an empty rectangle be displayed to serve as a placeholder? (This does not affect behavior when the output is nonempty.)

Returns

Type Description
Tag A UI element

See Also

Example

See output_text

Examples

#| standalone: true
#| components: [editor, viewer]
#| layout: vertical
#| viewerHeight: 400

## file: app.py
from shiny import App, Inputs, Outputs, Session, render, ui

app_ui = ui.page_fluid(
    ui.input_text("caption", "Caption:", "Data summary"),
    ui.output_text_verbatim("value"),
)


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


app = App(app_ui, server)