Skip to content

input

A control that displays some text that can potentially be edited.

Properties

Name Type Default Description
value(★) dynamic(Any) None

The value represented by this control.

password bool False

If True, the text is obscured: all input characters are displayed as an asterisk ('*').

label str None

The label associated with the input.

multiline bool False

If True, the text is presented as a multi line input.

lines_shown int 5

The height of the displayed element if multiline is True.

change_delay int App config

Minimum time between triggering two calls to the on_change callback. The default value is defined at the application configuration level by the change_delay configuration option. if None, the delay is set to 300 ms.

on_action Callback

Name of a function that is triggered when a specific key is pressed.
The parameters of that function are all optional:

  • state (State): the state instance.
  • id (str): the identifier of the input.
  • action (str): the name of the action that provoked the change.
  • payload (dict): the details on this callback's invocation.
    This dictionary has the following keys:
    • args (List):
      • key name
      • variable name
      • current value

action_keys str "Enter"

Semicolon (';')-separated list of supported key names. Authorized values are Enter, Escape, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12.

on_change Callback

The name of a function that is triggered when the value is updated.
The parameters of that function are all optional:

  • state (State): the state instance.
  • var_name (str): the variable name.
  • value (Any): the new value.

propagate bool App config

Allows the control's main value to be automatically propagated.
The default value is defined at the application configuration level. If True, any change to the control's value is immediately reflected in the bound application variable.

(★)value is the default property for this visual element.

Usage

Get user input

You can create an input field bound to a variable with the following content:

Page content

<|{value}|input|>
<taipy:input>{value}</taipy:input>