Skip to content

Checkbox

pywry.toolbar.Checkbox

Bases: ToolbarItem

A single checkbox for boolean values.

Emits {value: ..., componentId: ...} on check/uncheck.

ATTRIBUTE DESCRIPTION
value

Initial checked state (default: False).

TYPE: bool

Examples:

>>> Checkbox(label="Enable notifications", event="settings:notify", value=True)

Functions

build_html

build_html() -> str

Build checkbox HTML.

auto_generate_component_id

auto_generate_component_id() -> ToolbarItem

Auto-generate component_id based on type if not provided.

validate_event_name classmethod

validate_event_name(v: str) -> str

Validate event follows namespace:event-name pattern.