{{ title }}
{% if subtitle %}
{{ subtitle }}
{% end %}{% slot header_actions %}
{% slot media %}
{% slot %}
{% slot body_actions %}
{#- chirp-ui: Card component Headless card with optional header, footer, collapsible, and variants. Named slots: header_actions, media, body_actions (for list cards), footer, default (body). Link variants also expose header_badge, header_subtitle, top_meta. Usage: from "chirpui/card.html" import card call card(title="My Card")
Card body content.
end call card(title="Settings", icon="⚙") {% slot header_actions %}{% end %}Body content.
end call card(title="Feature", variant="feature") {% slot media %}Body content.
{% slot footer %}Tags or metadata here{% end %} end call card(title="Usage", attrs_map={"id": "usage-widget"})Stable id on the outer article for hx-target="#usage-widget".
end Footer: use {% slot footer %} (preferred). The legacy footer= string parameter still works but emits a ChirpUIDeprecationWarning. -#} {% def card(title=none, subtitle=none, footer=none, collapsible=false, open=false, variant="", appearance="", tone="", icon=none, border_variant="", header_variant="", cls="", hoverable=false, attrs="", attrs_unsafe="", attrs_map=none) %} {% set _attrs_raw = attrs_unsafe or (attrs | deprecate_param("attrs", "attrs_unsafe or attrs_map")) %} {% set _footer_text = footer | deprecate_param("footer", "{% slot footer %}...{% end %}") %} {% set _appearance = appearance | validate_appearance_block("card", "") %} {% set _tone = tone | validate_tone_block("card", "") %} {# @provides _card_variant — consumed by: alert, badge, divider, settings_row #} {% provide _card_variant = variant %} {% let _card_mods = (["collapsible"] if collapsible else []) + (["gradient-border"] if border_variant == "gradient" else []) + (["gradient-header"] if header_variant == "gradient" else []) + (["hoverable"] if hoverable else []) %} {% let _card_class = "card" | bem(variant=variant, appearance=_appearance, tone=_tone, modifier=_card_mods, cls=cls) %} {% if collapsible %}{{ subtitle }}
{% end %}{{ subtitle }}
{% end %}{{ subtitle }}
{% end %}{{ description }}
{% endif %} {% slot %}{{ description }}
{% endif %} {% slot %}