Skip to content

Radio set

Preview

textual_wizard.inputs.RadioSet

RadioSet(
    name: str,
    label: str,
    *,
    options: list[str],
    default_value: Optional[str] = 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. An option is represented by a string.

TYPE: list[str]

default_value

The default value of the input (str).

TYPE: Optional[str] DEFAULT: None

default_value instance-attribute

default_value: str = default_value

label instance-attribute

label: str = label

name instance-attribute

name: str = name

options instance-attribute

options: list[str] = options

wid instance-attribute

wid: RadioSet

inq_ask

inq_ask() -> FieldValueType