Skip to content

Select input

Slide your cursor over the image to see the select field closed or opened.

textual_wizard.inputs.Select

Select(
    name: str,
    label: str,
    *,
    options: list[tuple[str, FieldValueType]],
    default_value: Optional[FieldValueType] = None
)

Bases: InputType, Generic[FieldValueType]

Allows the user to select a value within a predefined list of options.

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.

TYPE: list[tuple[str, FieldValueType]]

default_value

The default value of the input. You must specify an element by its return value (the second thingy in the option tuple).

TYPE: Optional[FieldValueType] DEFAULT: None