Skip to main content

Text Input

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

NameDescriptionType
labelThe label to display to the userstr
initial_valueThe initial value to display to the user. Defaults to "".str
placeholderThe placeholder text to display to the user. Defaults to "Placeholder".str
maskA mask to apply to the input. Defaults to None.str
maxLengthThe maximum length of the input. Defaults to None.int
minLengthThe minimum length of the input. Defaults to None.int
disabledwhether the input is disabled. Defaults to False.bool
requiredWhether the input is required or not eg. "this field is required". Defaults to True.Union[bool, str]
hintA tooltip displayed to the user. Defaults to None.str
full_widthWhether the input should use full screen width. Defaults to False.bool
button_textWhat text to display on the button when the widget is not part of a Page. Defaults to 'Next'.str

Return Values

TypeDescription
strThe value entered by the user