Ü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

Radio

Zustände

Radio-Buttons aus, an, Fehler, deaktiviert und in drei Größen.

Code<div class="tc-cluster" style="--tc-gap: 48px; align-items: flex-start"> <div class="tc-stack" style="--tc-gap: 12px"> {% tc_radio# name="protocol_a" value="wireguard" label="WireGuard" checked=True %} {% tc_radio# name="protocol_a" value="openvpn" label="OpenVPN" %} {% tc_radio# name="protocol_b" value="ipsec" label="IPsec" error="Bitte eine Option wählen." %} {% tc_radio# name="protocol_c" value="pptp" label="PPTP (veraltet)" disabled=True %} {% tc_radio# name="protocol_d" value="l2tp" label="L2TP" checked=True disabled=True %} </div> <div class="tc-stack" style="--tc-gap: 12px"> {% tc_radio# name="size_demo_sm" label="WireGuard (SM)" size="sm" checked=True %} {% tc_radio# name="size_demo_md" label="WireGuard (MD)" checked=True %} {% tc_radio# name="size_demo_lg" label="WireGuard (LG)" size="lg" checked=True %} {% tc_radio# name="size_demo_help" label="WireGuard" help="Schnell und modern, empfohlen." checked=True %} </div> </div>

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.
value'on'–Submitted value when checked.
checkedFalse–Checked state.
disabledFalse–Disable the control.
size'md'Box and text size: sm 14 px / Body SM, md 16 px / Body MD, lg 20 px / Body LG.

Verwendung

{% load components tomcom_theme %} {% tc_radio label="…" required="…" %}…{% endtc_radio %} {% tc_radio# %} {# 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.