@_with_element
def text_input(self, element, label, value='', max_chars=None, key=None, type='default'):
    'Display a single-line text input widget.\n\n        Parameters\n        ----------\n        label : str\n            A short label explaining to the user what this input is for.\n        value : any\n            The text value of this widget when it first renders. This will be\n            cast to str internally.\n        max_chars : int or None\n            Max number of characters allowed in text input.\n        key : str\n            An optional string to use as the unique key for the widget.\n            If this is omitted, a key will be generated for the widget\n            based on its content. Multiple widgets of the same type may\n            not share the same key.\n        type : str\n            The type of the text input. This can be either "default" (for\n            a regular text input), or "password" (for a text input that\n            masks the user\'s typed value). Defaults to "default".\n\n        Returns\n        -------\n        str\n            The current value of the text input widget.\n\n        Example\n        -------\n        >>> title = st.text_input(\'Movie title\', \'Life of Brian\')\n        >>> st.write(\'The current movie title is\', title)\n\n        '
    element.text_input.label = label
    element.text_input.default = str(value)
    if (max_chars is not None):
        element.text_input.max_chars = max_chars
    if (type == 'default'):
        element.text_input.type = TextInput.DEFAULT
    elif (type == 'password'):
        element.text_input.type = TextInput.PASSWORD
    else:
        raise StreamlitAPIException(("'%s' is not a valid text_input type. Valid types are 'default' and 'password'." % type))
    ui_value = _get_widget_ui_value('text_input', element, user_key=key)
    current_value = (ui_value if (ui_value is not None) else value)
    return str(current_value)
Display a single-line text input widget.

Parameters
----------
label : str
    A short label explaining to the user what this input is for.
value : any
    The text value of this widget when it first renders. This will be
    cast to str internally.
max_chars : int or None
    Max number of characters allowed in text input.
key : str
    An optional string to use as the unique key for the widget.
    If this is omitted, a key will be generated for the widget
    based on its content. Multiple widgets of the same type may
    not share the same key.
type : str
    The type of the text input. This can be either "default" (for
    a regular text input), or "password" (for a text input that
    masks the user's typed value). Defaults to "default".

Returns
-------
str
    The current value of the text input widget.

Example
-------
>>> title = st.text_input('Movie title', 'Life of Brian')
>>> st.write('The current movie title is', title)
@_with_element
def text_input(self, element, label, value=, max_chars=None, key=None, type='default'):
    'Display a single-line text input widget.\n\n        Parameters\n        ----------\n        label : str\n            A short label explaining to the user what this input is for.\n        value : any\n            The text value of this widget when it first renders. This will be\n            cast to str internally.\n        max_chars : int or None\n            Max number of characters allowed in text input.\n        key : str\n            An optional string to use as the unique key for the widget.\n            If this is omitted, a key will be generated for the widget\n            based on its content. Multiple widgets of the same type may\n            not share the same key.\n        type : str\n            The type of the text input. This can be either "default" (for\n            a regular text input), or "password" (for a text input that\n            masks the user\'s typed value). Defaults to "default".\n\n        Returns\n        -------\n        str\n            The current value of the text input widget.\n\n        Example\n        -------\n        >>> title = st.text_input(\'Movie title\', \'Life of Brian\')\n        >>> st.write(\'The current movie title is\', title)\n\n        '
    element.text_input.label = label
    element.text_input.default = str(value)
    if (max_chars is not None):
        element.text_input.max_chars = max_chars
    if (type == 'default'):
        element.text_input.type = TextInput.DEFAULT
    elif (type == 'password'):
        element.text_input.type = TextInput.PASSWORD
    else:
        raise StreamlitAPIException(("'%s' is not a valid text_input type. Valid types are 'default' and 'password'." % type))
    ui_value = _get_widget_ui_value('text_input', element, user_key=key)
    current_value = (ui_value if (ui_value is not None) else value)
    return str(current_value)