chirp-ui variant validation — strict mode, warning infrastructure, and registries.
When strict mode is enabled (viaset_strict()), validation warnings
escalate toValueError. In non-strict mode, _warn() emits a
filterableChirpUIValidationWarningso developers see feedback
without crashes.
VARIANT_REGISTRY, APPEARANCE_REGISTRY, TONE_REGISTRY, and
SIZE_REGISTRYare derived from the canonical component descriptors in
chirp_ui.components.
Everything not in all is internal and may change without notice.
validation
| Name | Type | Default | Description |
|---|---|---|---|
type
|
|
— | |
qualified_name
|
|
— | |
element_type
|
|
— | |
description
|
|
— | |
source_file
|
|
— | |
line_number
|
|
— | |
is_autodoc
|
|
— | |
autodoc_element
|
|
— | |
_autodoc_template
|
|
— | |
_autodoc_url_path
|
|
— | |
_autodoc_page_type
|
|
— | |
title
|
|
— | |
doc_content_hash
|
|
— |
Symbols on this page
Base warning for chirp-ui issues.
Invalid input that was silently corrected.
Deprecated chirp-ui feature.
Set strict mode for chirp-ui variant validation.
When True, validation warnings escalate toValueError. When
"auto", reads the CHIRP_UI_DEVenvironment variable (truthy…
Return True when strict mode is active for this context.
ChirpUIWarning
class
Base warning for chirp-ui issues.
ChirpUIValidationWarning
class
Invalid input that was silently corrected.
ChirpUIDeprecationWarning
class
Deprecated chirp-ui feature.
set_strict
function
def set_strict(strict: bool | Literal['auto']) -> None
Set strict mode for chirp-ui variant validation.
When True, validation warnings escalate toValueError. When
"auto", reads the CHIRP_UI_DEVenvironment variable (truthy
values:1, true, yes, on) at call time — so dev hosts
opt in once at startup and get strict validation automatically.
Chirp calls this per request when use_chirp_ui(app, strict=...) is used.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
strict
|
bool | Literal['auto']
|
— |
is_strict
function
def is_strict() -> bool
Return True when strict mode is active for this context.
No parameters.
View source · /home/runner/work/chirp-ui/chirp-ui/site/../src/chirp_ui/validation.py:1