Skip to main content

ToggleInput

Toggle switch input widget for capturing boolean values.

Signature

def ToggleInput(
label: str,
key: str = None,
on_text: str = 'Yes',
off_text: str = 'No',
required: bool = True,
hint: str = None,
full_width: bool = False,
disabled: bool = False,
errors: Union[List[str], str] = None
)

Parameters

NameDescriptionTypeDefault
label (required)Text label displayed next to the toggle.strNone
keyIdentifier for the widget, defaults to label if not provided.strNone
on_textText to display when the toggle is on.str'Yes'
off_textText to display when the toggle is off.str'No'
requiredWhether the toggle must be switched on before proceeding.boolTrue
hintHelp text displayed below the toggle.strNone
full_widthWhether the widget should take up the full width of its container.boolFalse
disabledWhether the toggle is non-interactive.boolFalse
errorsPre-defined validation error messages to display.Union[List[str], str]None