Skip to content

Selection list

Preview

textual_wizard.inputs.SelectionList

SelectionList(
    name: str,
    label: str,
    *,
    options: Sequence[
        tuple[str, FieldValueType, bool]
        | tuple[FieldValueType, bool]
    ]
)

Bases: InputType, Generic[FieldValueType]

Allows the user to select multiple options within a predifined list, similar to a checklist.

PARAMETER DESCRIPTION
name

The input identifier, used as key in the returned answers dict.

TYPE: str

label

The title of the input, displayed to the user.

TYPE: str

options

A list of options that can be selected by the user. An option can be represented: - by a tuple ("display string", actual_value, is_selected) - or the "display string" can be omitted and the value will be converted to a string

TYPE: Sequence[tuple[str, FieldValueType, bool] | tuple[FieldValueType, bool]]