PasswordInput
Password input widget for capturing sensitive text with masked display.
Examples
Basic Usage
This example runs a form with a single page containing the widget
Example Code
from abstra.forms import PasswordInput, run
# Create a page with the widget
example_page = [
PasswordInput(label="Password Input", key="my-password_input"),
]
# Run the form
result = run([example_page])
# Print the result
print(result)
Parameters
Name | Description | Type | Default |
---|---|---|---|
label (required) | Text label displayed above the input. | str | None |
key | Identifier for the widget, defaults to label if not provided. | str | None |
hint | Help text displayed below the input. | str | None |
required | Whether the input must be filled before proceeding. | bool | True |
full_width | Whether the input should take up the full width of its container. | bool | False |
lowercase_required | Whether the input must contain at least one lowercase letter. | bool | False |
uppercase_required | Whether the input must contain at least one uppercase letter. | bool | False |
special_required | Whether the input must contain at least one special character. | bool | False |
digit_required | Whether the input must contain at least one digit. | bool | False |
min_length | Minimum number of characters required. | int | None |
max_length | Maximum number of characters allowed. | int | None |
size | Size of the input. | int | None |
pattern | Regular expression pattern for input validation. | str | None |
autocomplete | Autocomplete attribute for the input. | str | None |
placeholder | Placeholder text displayed when the input is empty. | str | None |
disabled | Whether the input is non-interactive. | bool | False |
secret | Whether the input is a secret (e.g., for passwords). | bool | False |
errors | Pre-defined validation error messages to display. | Union[List[str], str] | None |
State Value
str
: The password value entered by the user.
info
This is the type of the value that this widget holds. It will show up when accessing widget's state item.
This also defines which value type can be used on initial_state