Skip to main content

DropdownInput

Dropdown select widget allowing selection from predefined options.

Examples

Basic Usage

This example runs a form with a single page containing the widget

Example Code

from abstra.forms import DropdownInput, run

# Create a page with the widget
example_page = [
DropdownInput(
label="Dropdown Input",
key="my-dropdown_input",
options=["Option A", "Option B", "Option C"],
),
]

# Run the form
result = run([example_page])

# Print the result
print(result)

Parameters

NameDescriptionTypeDefault
label (required)Text label displayed above the dropdown.strNone
options (required)List of options to choose from, as AbstraOption objects.List[AbstraOption]None
keyIdentifier for the widget, defaults to label if not provided.strNone
requiredWhether a selection is required before proceeding.boolTrue
hintHelp text displayed below the dropdown.strNone
placeholderText shown when no option is selected.str''
full_widthWhether the dropdown should take up the full width of its container.boolFalse
disabledWhether the dropdown is non-interactive.boolFalse
multipleWhether multiple options can be selected.boolFalse
minMinimum number of selections required when multiple=True.intNone
maxMaximum number of selections allowed when multiple=True.intNone
errorsPre-defined validation error messages to display.Union[List[str], str]None