Component descriptors — single source of truth for chirp-ui's BEM API surface.
EachComponentDescriptordeclares the full public contract of a component:
block name, allowed variants (legacy/mutually exclusive), appearances, tones,
sizes, boolean modifiers (additive), BEM elements, Kida slot names, and
overridable CSS custom properties.
Downstream consumers:
VARIANT_REGISTRY/SIZE_REGISTRYinchirp_ui.validationderive fromCOMPONENTS.- The
bem()filter validates against descriptors when strict mode is on. - Contract tests auto-generate expected CSS class names from descriptors.
design_system_report() exposes the full surface for introspection.
components
| 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
Explicit mapping from a composite's public slot to a composed child slot.
slot and target_slot use ""for the default slot, matching
slotsand…
Frozen description of a single chirp-ui component's public CSS API.
Fields
block : str
BEM block name (e.g."btn"). CSS class becomes chirpui-\{block}…
Aggregate counts for the design system surface.
Machine-readable summary of the chirp-ui design system surface.
Machine-readable summary of the full chirp-ui design system surface.
Returns the same live projection asbuild_manifest(), including derived macro signatures, runtime requirements, provide/consume…
SlotForward
class
Explicit mapping from a composite's public slot to a composed child slot.
slot and target_slot use ""for the default slot, matching
slotsand the manifest convention.
target is a key in COMPONENTS, not a CSS block or macro name.
ComponentDescriptor
class
Frozen description of a single chirp-ui component's public CSS API.
Fields
block : str
BEM block name (e.g."btn"). CSS class becomes chirpui-\{block}.
variants : tuple[str, ...]
Mutually-exclusive modifiers (chirpui-{block}--\{variant}).
Empty string""means "no variant class emitted".
appearances : tuple[str, ...]
Cross-component visual treatment values the component opts into
(chirpui-{block}--\{appearance}). These are descriptor-backed macro
params, not global utility classes.
tones : tuple[str, ...]
Semantic intent values the component opts into
(chirpui-{block}--\{tone}). dangeris the shared destructive
tone; legacyerrorvalues remain component-local variants.
sizes : tuple[str, ...]
Size modifiers (chirpui-{block}--\{size}).
modifiers : tuple[str, ...]
Additive boolean modifiers that can combine with variant/size
(e.g."loading" → chirpui-btn--loading).
elements : tuple[str, ...]
BEM elements (chirpui-{block}__\{element}).
slots : tuple[str, ...]
Public caller slots the macro accepts (""= default slot). This
includes direct Kida{% slot %}placeholders and caller content
forwarded into composed children.
composes : tuple[str, ...]
Component registry keys this component semantically composes.
slot_forwards : tuple[SlotForward, ...]
Explicit public-slot forwarding contracts into composed children.
tokens : tuple[str, ...]
Component-scoped CSS custom properties (override knobs for theming).
extra_emits : tuple[str, ...]
Escape hatch for classes the BEM grammar cannot derive
(compound-state classes, internal structural elements not surfaced
as BEM elements, etc.). Joined intoemits.
trim_emits : tuple[str, ...]
Explicitly removes grammar-derived classes that are accepted by a
descriptor's public vocabulary but intentionally have no standalone
CSS rule (for example implicit/default variants).
template : str
Filename intemplates/chirpui/ (e.g. "button.html").
category : str
Grouping label for documentation/introspection.
maturity : str
Stability tier for agents and docs. Public descriptors set this
explicitly so the manifest does not infer product readiness.
role : str
Semantic role for discovery/agent planning. Empty means "derive from
category" (effects →effect, composites → pattern, etc.).
authoring : str
Agent-facing authoring hint."preferred"marks vocabulary to reach
for first,"compatibility"marks retained legacy surface, and empty
derives from maturity (legacy → compatibility, internal → internal,
everything else → available).
requires : tuple[str, ...]
Runtime features the component needs when rendered. Keep explicit
entries for non-obvious requirements; the manifest may add derived
requirements (for example Alpine factories) during projection.
macro : str | None
Macro identifier insidetemplate (e.g. "shimmer_button").
WhenNone, defaults to block.replace("-", "_")at lookup
time. Set explicitly only when the macro name diverges from the BEM
block (e.g.block="shimmer-btn" → macro="shimmer_button").
Used bychirp_ui.manifestto resolve param signatures from
the template AST.
DesignSystemStats
class
Aggregate counts for the design system surface.
DesignSystemReport
class
Machine-readable summary of the chirp-ui design system surface.
design_system_report
function
def design_system_report() -> DesignSystemReport
Machine-readable summary of the full chirp-ui design system surface.
Returns the same live projection asbuild_manifest(),
including derived macro signatures, runtime requirements, provide/consume
keys, descriptions, theme packs, and aggregate quality stats. The historical
top-level keys ("components", "tokens", and "stats") remain
present for existing callers.
No parameters.
View source · /home/runner/work/chirp-ui/chirp-ui/site/../src/chirp_ui/components.py:1