Übersicht FarbenTypografieAbstände & RasterIcons ButtonButton GroupIcon ButtonLink CheckboxCheckbox GroupChipChip GroupComboboxDate PickerFieldField LabelFieldsFile UploadFormForm SectionInputInput GroupOTP InputPasswordRadioRadio GroupRange SliderReset ButtonSave ButtonSearchSegmented ControlSelectSliderSwitchTextareaTime Picker AvatarAvatar GroupBadgeChartCode BlockCopy ValueData TableInline StatKey ValueList GroupList RowsMeta ItemQR CodeStatStat StripTableTag AlertEmpty StateGuideLive StatusMessagesProgressSkeletonToast DialogDrawerDropdownMenuMenu ItemPopoverTooltip BreadcrumbContent NavigationDate NavigationPaginationSidebarStepperTabsTheme SwitchTopbar AccordionAccordion ItemApp ShellCardDividerFooterPage HeaderSection HeaderSplit Panel DashboardListeFormularDetailansichtEinstellungenMehrschritt-AssistentLeerer StartLoginFehlerseite IconsMusterAdmin

Checkbox Group

Ausrichtung

Checkbox-Gruppe vertikal mit Hilfetext und horizontal mit Fehlertext.

Code<div class="tc-cluster" style="--tc-gap: 48px; align-items: flex-start"> {% tc_checkbox_group# label="Benachrichtigungen" name="channels" options="mail=E-Mail|push=Push-Nachricht|sms=SMS" value="mail" help="Mehrfachauswahl möglich." %} {% tc_checkbox_group# label="Benachrichtigungen" name="channels_error" orientation="horizontal" options="mail=E-Mail|push=Push-Nachricht|sms=SMS" required=True error="Bitte mindestens einen Kanal wählen." %} </div>

Eigene Einträge

Checkboxen mit Hilfetext im Slot und deaktivierter Option.

Code{% tc_checkbox_group label="Berechtigungen" optional=True %} {% tc_checkbox# name="permissions" value="read" label="Lesen" checked=True help="Einträge und Berichte ansehen." %} {% tc_checkbox# name="permissions" value="write" label="Bearbeiten" help="Einträge anlegen und ändern." %} {% tc_checkbox# name="permissions" value="admin" label="Verwalten" disabled=True help="Nur durch Administratoren vergebbar." %} {% endtc_checkbox_group %}

Rohes HTML

tc-checkbox-group mit tc-checkbox-Kindern; die Gruppe sendet alle gewählten Werte unter einem Namen.

Code<tc-checkbox-group name="channels" label="Benachrichtigungen" help="Mehrfachauswahl möglich." required> <tc-checkbox value="mail" label="E-Mail" checked></tc-checkbox> <tc-checkbox value="push" label="Push-Nachricht"></tc-checkbox> <tc-checkbox value="sms" label="SMS"></tc-checkbox> </tc-checkbox-group>

API

OptionStandardWerteBeschreibung
label''–Visible label text.
requiredFalse–Mark as required: native required attribute plus a red asterisk.
optionalFalse–Show the "optional" marker after the label (ignored when required).
label_icon''–Explanation shown as a help icon with tooltip after the label.
hide_labelFalse–Keep the label for assistive technology only.
help''–Hint below the control (Figma: Hint / Help Text).
error''–Error message or list of messages (e.g. Django field.errors); sets the error state, aria-invalid and aria-describedby. Replaces the hint while shown.
state''Validation state without an error message: success or warning colour the border and the hint.
name''–Form field name shared by all options.
options'()'–Options: Django choices, dictionaries (value, label, help, disabled, id) or "value=Label|value=Label". Alternatively place tc_checkbox/tc_radio tags in the slot.
orientation'vertical'Stack options vertically (gap 8) or in a row (gap 24).
disabledFalse–Disable every option.
size'md'Box and text size: sm 14 px / Body SM, md 16 px / Body MD, lg 20 px / Body LG.
value'None'–Checked values: list or "a,b".

Verwendung

{% load components tomcom_theme %} {% tc_checkbox_group label="…" required="…" %}…{% endtc_checkbox_group %} {% tc_checkbox_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.