Skip to main content

CheckboxInput

Checkbox input widget for capturing boolean values.

Examples

Basic Usage

This example runs a form with a single page containing the widget

Example Code

from abstra.forms import CheckboxInput, run

# Create a page with the widget
example_page = [
CheckboxInput(label="Checkbox Input", key="my-checkbox_input"),
]

# Run the form
result = run([example_page])

# Print the result
print(result)

Parameters

NameDescriptionTypeDefault
label (required)Text label displayed next to the checkbox.strNone
keyIdentifier for the widget, defaults to label if not provided.strNone
requiredWhether the checkbox must be checked before proceeding.boolTrue
hintHelp text displayed below the checkbox.strNone
full_widthWhether the widget should take up the full width of its container.boolFalse
disabledWhether the checkbox is non-interactive.boolFalse
errorsPre-defined validation error messages to display.Union[list, str]None