Text Input
info
This widget is deprecated. Use the Text Input widget instead.
Collects plain text input with customizable placeholders and validation.
Examples
Basic Example
The following example demonstrate some of the available functionality for read
from abstra.forms import read
name = read("What is your name?")
Mask Example
The following example shows the usage of the mask property for read widget. In the mask property, the '0' digit represents a numeric value, the 'a' digit represents an alphabetic value and other digits are recognized as part of the value
from abstra.forms import read
read("What is your credit card number?", mask="0000 0000 0000 0000")
Parameters
Name | Description | Type |
---|---|---|
label | The label to display to the user | str |
initial_value | The initial value to display to the user. Defaults to "". | str |
placeholder | The placeholder text to display to the user. Defaults to "Placeholder". | str |
mask | A mask to apply to the input. Defaults to None. | str |
max_length | The maximum length of the input. Defaults to None. | int |
min_length | The minimum length of the input. Defaults to None. | int |
disabled | whether the input is disabled. Defaults to False. | bool |
required | Whether the input is required or not eg. "this field is required". Defaults to True. | Union[bool, str] |
hint | A tooltip displayed to the user. Defaults to None. | str |
full_width | Whether the input should use full screen width. Defaults to False. | bool |
button_text | What text to display on the button when the widget is not part of a Page. Defaults to 'Next'. | str |
Return Values
Type | Description |
---|---|
str | The value entered by the user |