input
A control that displays some text that can potentially be edited.
Properties¶
| Name | Type | Default | Description |
|---|---|---|---|
(★) |
Anydynamic |
None | The value represented by this control. |
password |
bool |
False | If True, the text is obscured, and all characters are displayed as asterisks ('*'). |
label |
str |
None | The label associated with the input field. |
multiline |
bool |
False | If True, the input is rendered as a multi-line text area |
lines_shown |
int |
5 | The number of lines displayed in the input control when multiline is True. |
type |
str |
"text" | The type of input element, as per HTML input types. |
action_on_blur |
bool |
False | If True, the |
change_delay |
int |
App config | The minimum interval (in milliseconds) between two consecutive calls to the |
on_action |
Union[str, Callable] |
A function or the name of a function that is triggered when a specific key is pressed.
|
|
action_keys |
str |
"Enter" | A semicolon-separated list of keys that can trigger the |
width |
Union[str, int] |
None | The width of the element, in CSS units. |
on_change |
Union[str, Callable] |
A function or the name of a function that is triggered when the value changes.
|
|
propagate |
bool |
App config | Determines whether the control's value is automatically reflected in the bound application variable. |
active |
booldynamic |
True | Indicates if this element is active. |
id |
str |
The identifier assigned to the rendered HTML component. |
|
properties |
dict[str, Any] |
A dictionary of additional properties that can be set to the element. |
|
class_name |
strdynamic |
A space-separated list of CSS class names to be applied to the generated HTML element. |
|
hover_text |
strdynamic |
The text that is displayed when the user hovers over the element. |
(★)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:
Definition
<|{value}|input|>
<taipy:input>{value}</taipy:input>
import taipy.gui.builder as tgb
...
tgb.input("{value}")
Styling¶
All the input controls are generated with the "taipy-input" CSS class. You can use this class name to select the input controls on your page and apply style.
Stylekit support¶
The Stylekit provides a specific class that you can use to style input controls:
- fullwidth
If an input control uses the fullwidth class, then it uses the whole available horizontal space.