ChecklistInput
Checklist input widget for selecting multiple options from a list.
Examples
Basic Usage
This example runs a form with a single page containing the widget
Example Code
from abstra.forms import ChecklistInput, run
# Create a page with the widget
example_page = [
ChecklistInput(
label="Checklist Input",
key="my-checklist_input",
options=["Option A", "Option B", "Option C"],
),
]
# Run the form
result = run([example_page])
# Print the result
print(result)
Parameters
Name | Description | Type | Default |
---|---|---|---|
label (required) | Text label displayed above the checklist. | str | None |
options (required) | List of options to choose from, either as {"label": str, "value": str} dictionaries or simple strings. | Union[List[LabelValueDict], List[str]] | None |
key | Identifier for the widget, defaults to label if not provided. | str | None |
required | Whether at least one option must be selected before proceeding. | bool | True |
hint | Help text displayed below the checklist. | str | None |
full_width | Whether the checklist should take up the full width of its container. | bool | False |
disabled | Whether the checklist is non-interactive. | bool | False |
min | Minimum number of options that must be selected. | int | 0 |
max | Maximum number of options that can be selected. | int | None |
errors | Pre-defined validation error messages to display. | List[str] | None |
State Value
List[object]
: The list of selected values.
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