Ü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

Input

Zustände

Eingabefelder in den Zuständen Standard, Platzhalter, Fehler, Erfolg, Warnung, deaktiviert und schreibgeschützt.

Code<div class="tc-stack" style="--tc-gap: 20px; max-width: 360px"> {% tc_input# label="Hostname" name="hostname" value="gateway-01.example.com" help="Vollqualifizierter Name ohne Protokoll." %} {% tc_input# label="Hostname" name="hostname_placeholder" placeholder="z. B. gateway-01.example.com" help="Vollqualifizierter Name ohne Protokoll." %} {% tc_input# label="Hostname" name="hostname_error" value="gateway-01" error="Bitte einen vollqualifizierten Namen eingeben." required=True %} {% tc_input# label="Hostname" name="hostname_success" value="gateway-01.example.com" state="success" help="Name ist verfügbar." %} {% tc_input# label="Hostname" name="hostname_warning" value="gateway-01.example.com" state="warning" help="Name wird bereits von einem inaktiven Gerät genutzt." %} {% tc_input# label="Hostname" name="hostname_disabled" value="gateway-01.example.com" disabled=True help="Wird vom Netzwerkteam verwaltet." %} {% tc_input# label="Hostname" name="hostname_readonly" value="gateway-01.example.com" readonly=True %} </div>

Größen

SM, MD und LG passen zur Höhe der Buttons in derselben Zeile.

Code<div class="tc-stack" style="--tc-gap: 20px; max-width: 360px"> {% tc_input# label="Kunde (SM)" name="customer_sm" size="sm" value="Muster GmbH" %} {% tc_input# label="Kunde (MD)" name="customer_md" value="Muster GmbH" %} {% tc_input# label="Kunde (LG)" name="customer_lg" size="lg" value="Muster GmbH" %} <div class="tc-cluster" style="align-items: flex-end"> <div style="flex: 1 1 200px">{% tc_input# label="Ticket-Nummer" name="ticket" size="sm" placeholder="TCK-0000" mono=True %}</div> {% tc_button# size="sm" variant="outlined" label="Suchen" %} </div> </div>

Optionen

Pflichtfeld, optional, Label-Icon mit Tooltip, Icons, Löschen-Button und Zeichenzähler.

Code<div class="tc-stack" style="--tc-gap: 20px; max-width: 360px"> {% tc_input# label="E-Mail" name="email" type="email" required=True icon="email" placeholder="max.mustermann@example.com" autocomplete="email" %} {% tc_input# label="Abteilung" name="department" optional=True value="Entwicklung" clearable=True %} {% tc_input# label="IP-Adresse" name="ip" value="10.0.4.17" mono=True label_icon="IPv4-Adresse im internen Netz 10.0.0.0/16." %} {% tc_input# label="Bezeichnung" name="title" value="Notebook E. Musterfrau" counter=True maxlength=50 help="Erscheint in der Übersicht." %} {% tc_input# label="Website" name="website" type="url" icon_right="launch" value="https://example.com" %} {% tc_input# label="Hostname" name="hostname_hidden" hide_label=True placeholder="Hostname ohne Label (nur für Screenreader)" %} </div>

Rohes HTML

tc-input ohne Template-Tag, z. B. aus JavaScript oder HTMX-Antworten; der Browser baut das Shadow DOM selbst.

Code<div class="tc-stack" style="--tc-gap: 20px; max-width: 360px"> <tc-input name="hostname" label="Hostname" value="gateway-01.example.com" help="Vollqualifizierter Name ohne Protokoll." clearable></tc-input> <tc-input name="ip" label="IP-Adresse" value="10.0.4.17" mono error="Liegt außerhalb von 10.0.0.0/16."></tc-input> <tc-input name="title" label="Bezeichnung" maxlength="50" counter optional="optional" placeholder="z. B. Notebook E. Musterfrau"></tc-input> </div>

JavaScript-API

Eigenschaften value und error, Ereignisse tc-input, tc-change und tc-clear.

Letztes Ereignis: –

Code<div class="tc-stack" style="--tc-gap: 12px; max-width: 360px"> {% tc_input# label="Hostname" name="api_host" value="gateway" clearable=True help="Mindestens ein Punkt (Domain)." %} <p class="tc-text-body-sm tc-text-secondary" aria-live="polite">Letztes Ereignis: <span class="tc-mono">–</span></p> <script> (function (root) { const input = root.querySelector('tc-input'); const log = root.querySelector('.tc-mono'); ['tc-input', 'tc-change', 'tc-clear'].forEach(name => input.addEventListener(name, event => { log.textContent = name + ' ' + JSON.stringify(event.detail); input.error = input.value && !input.value.includes('.') ? 'Bitte einen vollqualifizierten Namen eingeben.' : ''; })); })(document.currentScript.parentElement); </script> </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 (Django html_name).
value'None'–Current value; dates and numbers are converted to their ISO/text form.
disabledFalse–Disable the control.
readonlyFalse–Read-only: value stays selectable and is submitted.
placeholder''–Placeholder text (never a replacement for the label).
size'md'Height: sm 28, md 36, lg 44 px (match the buttons in the same row).
type'text'Native input type.
icon''–Leading Carbon icon, e.g. "search" or "email".
icon_right''–Trailing Carbon icon.
clearableFalse–Show a clear button while the field has a value.
monoFalse–Monospaced value for technical values (hostnames, IPs, keys).
counterFalse–Show a character counter (Figma: Count); combine with maxlength.

Verwendung

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