Skip to main content

Custom List

Collects a dynamic list of values based on a specified schema.

Examples

Basic Example

The following example demonstrate some of the available functionality for read_list

from abstra.forms import ListItemSchema, read_list

item = ListItemSchema().read("Name").read_email("Email")
ans = read_list(item, min=1, max=3)
# ans = [{'Name': '', 'Email': ''}]

Parameters

NameDescriptionType
item_schemaThe schema for the items of the listAny
initial_value''array
minMin value accepted by the input. Defaults to None.float
maxMax value accepted by the input. Defaults to None.float
add_button_text''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
listThe values entered by the user