CardsInput
Card selection input widget for choosing from visual card options.
Signature
def CardsInput(
label: str,
options: List[CardOption],
key: str = None,
searchable: bool = False,
required: bool = True,
hint: str = None,
columns: int = 2,
full_width: bool = False,
layout: str = 'list',
disabled: bool = False,
min: int = None,
max: int = None,
errors: Union[List[str], str] = None
)
Parameters
Name | Description | Type | Default |
---|---|---|---|
label (required) | Text label displayed above the cards. | str | None |
options (required) | List of card options to display. | List[CardOption] | None |
key | Identifier for the widget, defaults to label if not provided. | str | None |
searchable | Whether cards can be filtered by search. | bool | False |
required | Whether a card selection is required before proceeding. | bool | True |
hint | Help text displayed below the input. | str | None |
columns | Number of columns to display cards in. | int | 2 |
full_width | Whether the cards should take up the full width of their container. | bool | False |
layout | Layout style for the cards ('list' or 'grid'). | str | 'list' |
disabled | Whether the input is non-interactive. | bool | False |
min | Minimum number of cards that must be selected when multiple=True. | int | None |
max | Maximum number of cards that can be selected when multiple=True. | int | None |
errors | Pre-defined validation error messages to display. | Union[List[str], str] | None |