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
Name | Description | Type |
---|---|---|
label | The label to display to the user | str |
placeholder | The placeholder text to display to the user. Defaults to "". | str |
lowercase_required | Whether the input must have at least one lowercase character. Defaults to True. | bool |
uppercase_required | Whether the input must have at least one uppercase character. Defaults to True. | bool |
special_required | Whether the input must have at least one special character. Defaults to True. | bool |
digit_required | Whether the input must have at least one digit. Defaults to True. | bool |
min_length | Minimum length of the password. Defaults to 8. | int |
max_length | Maximum length of the password. Defaults to None. | int |
size | Size of the password. Defaults to None. | int |
pattern | A regex pattern for the accepted password. Defaults to None. | str |
autocomplete | The autocomplete HTML attribute. Defaults to "current-password". | str |
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 |