Formulare
tc_chip_group
Wrapping row of chips with a group label (6 px gap). Pass items or tc_chip children; with type radio the group keeps a single selection.
Chip Group
Übersicht / Formulare / Chip Group In Figma
Beispiele 3 API Verwendung
Code {% tc_chip_group# label="Status filtern" name="status" items="Alle, Aktiv, Läuft ab, Gesperrt" %}
{% tc_chip_group label="Zeitraum" type="radio" %}
{% tc_chip# label="Heute" name="zeitraum" type="radio" value="heute" selected %}
{% tc_chip# label="Diese Woche" name="zeitraum" type="radio" value="woche" %}
{% tc_chip# label="Dieser Monat" name="zeitraum" type="radio" value="monat" %}
{% endtc_chip_group %}
Code {% tc_chip_group label="Standorte" %}
{% tc_chip# label="Standort A" count=24 selected %}
{% tc_chip# label="Standort B" count=18 %}
{% tc_chip# label="Standort C" count=9 %}
{% tc_chip# label="Homeoffice" count=31 selected %}
{% tc_chip# label="Rechenzentrum" count=4 %}
{% tc_chip# label="Ohne Standort" count=2 %}
{% endtc_chip_group %}
Code <tc-chip-group label="Zeitraum">
<tc-chip type="radio" name="raw-zeitraum" value="tag" label="Tag" selected></tc-chip>
<tc-chip type="radio" name="raw-zeitraum" value="woche" label="Woche"></tc-chip>
<tc-chip type="radio" name="raw-zeitraum" value="monat" label="Monat"></tc-chip>
</tc-chip-group>
API
Option Standard Werte Beschreibung
label''– Accessible group name (e.g. "Status filtern"). items'None'– List of dicts or comma-separated labels: label, count, value, selected, disabled. name''– Field name shared by all item chips. type'checkbox'checkbox radio Checkbox (multi) or radio (single) for item chips.
Verwendung
{% load components tomcom_theme %}
{% tc_chip_group label="…" items="…" %}…{% endtc_chip_group %}
{% tc_chip_group# %} {# inline form without content #}
Zusätzliche Attribute (z. B. class, aria-*, data-*) und HTMX-Kurzformen (get, post, get_url, post_url, target, swap, trigger, confirm) werden an das Element „root“ durchgereicht.