shiny.ui.input_text_area#

shiny.ui.input_text_area(id, label, value='', *, width=None, height=None, cols=None, rows=None, placeholder=None, resize=None, autocomplete=None, spellcheck=None)#

Create a textarea input control for entry of unstructured text values.

Parameters
  • id (str) – An input id.

  • label (Union[Tagifiable, Tag, MetadataNode, str, TagList, float, None, Dict[str, Union[str, float, bool, None]], Sequence[Union[Tagifiable, Tag, MetadataNode, str, TagList, float, None, Dict[str, Union[str, float, bool, None]], Sequence[ForwardRef]]]]) – An input label.

  • value (str) – Initial value.

  • width (Optional[str]) – The CSS width, e.g. ‘400px’, or ‘100%’

  • height (Optional[str]) – The CSS height, e.g. ‘400px’, or ‘100%’

  • cols (Optional[int]) – Value of the visible character columns of the input, e.g. 80. This argument will only take effect if there is not a CSS width rule defined for this element; such a rule could come from the width argument of this function or from a containing page layout such as page_fluid().

  • rows (Optional[int]) – The value of the visible character rows of the input, e.g. 6. If the height argument is specified, height will take precedence in the browser’s rendering.

  • placeholder (Optional[str]) – A hint as to what can be entered into the control.

  • resize (Optional[str]) – Which directions the textarea box can be resized. Can be one of “both”, “none”, “vertical”, and “horizontal”. The default, None, will use the client browser’s default setting for resizing textareas.

  • autocomplete (Optional[str]) – Whether to enable browser autocompletion of the text input (default is “off”). If None, then it will use the browser’s default behavior. Other possible values include “on”, “name”, “username”, and “email”. See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete for more.

  • spellcheck (Optional[Literal[‘true’, ‘false’]]) – Whether to enable browser spell checking of the text input (default is None). If None, then it will use the browser’s default behavior.

Return type

A UI element

Notes

Server value

A string containing the current text input. The default value is "" unless value is provided.

See also

input_text

Example

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

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):
    @output
    @render.text
    def value():
        return input.caption()


app = App(app_ui, server)