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: Sequence[
        tuple[str, FieldValueType] | FieldValueType
    ],
    default_value: Optional[FieldValueType] = None
)

Bases: InputType, Generic[FieldValueType]

Allows the user to select a value within a list of radio buttons

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: - any value that can be converted to a string - a tuple ("displayed text", actual_value)

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

default_value

The default value of the input. You must identify the default element by its actual value, (the second part of the tuple).

TYPE: Optional[FieldValueType] DEFAULT: None