Skip to main content

Password Input

A password field, including strength validation options.

Examples

Basic Example

The following example demonstrate some of the available functionality for read_password

from abstra.forms import read_password

ans = read_password("Insert your password below")

Parameters

NameDescriptionType
labelThe label to display to the userstr
placeholderThe placeholder text to display to the user. Defaults to "".str
lowercase_requiredWhether the input must have at least one lowercase character. Defaults to True.bool
uppercase_requiredWhether the input must have at least one uppercase character. Defaults to True.bool
special_requiredWhether the input must have at least one special character. Defaults to True.bool
digit_requiredWhether the input must have at least one digit. Defaults to True.bool
min_lengthMinimum length of the password. Defaults to 8.int
max_lengthMaximum length of the password. Defaults to None.int
sizeSize of the password. Defaults to None.int
patternA regex pattern for the accepted password. Defaults to None.str
autocompleteThe autocomplete HTML attribute. Defaults to "current-password".str
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