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
Name | Description | Type |
---|---|---|
item_schema | The schema for the items of the list | Any |
initial_value | '' | array |
min | Min value accepted by the input. Defaults to None. | float |
max | Max value accepted by the input. Defaults to None. | float |
add_button_text | '' | 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 |
---|---|
list | The values entered by the user |