Skip to main content

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

NameDescriptionTypeDefault
label (required)Text label displayed above the cards.strNone
options (required)List of card options to display.List[CardOption]None
keyIdentifier for the widget, defaults to label if not provided.strNone
searchableWhether cards can be filtered by search.boolFalse
requiredWhether a card selection is required before proceeding.boolTrue
hintHelp text displayed below the input.strNone
columnsNumber of columns to display cards in.int2
full_widthWhether the cards should take up the full width of their container.boolFalse
layoutLayout style for the cards ('list' or 'grid').str'list'
disabledWhether the input is non-interactive.boolFalse
minMinimum number of cards that must be selected when multiple=True.intNone
maxMaximum number of cards that can be selected when multiple=True.intNone
errorsPre-defined validation error messages to display.Union[List[str], str]None