Ü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

Password

Zustände

Passwortfeld mit Anzeigen-Schalter, Fehler und deaktiviert.

Code<div class="tc-stack" style="--tc-gap: 20px; max-width: 360px"> {% tc_password# label="Passwort" name="password" required=True %} {% tc_password# label="Passwort" name="password_error" value="geheim" error="Benutzername oder Passwort ist falsch." %} {% tc_password# label="Passwort" name="password_disabled" value="geheim" disabled=True %} </div>

Stärke

Vier-Segment-Anzeige mit Live-Meldung und optionaler Regel-Checkliste für neue Passwörter.

Code<div class="tc-stack" style="--tc-gap: 24px; max-width: 360px"> {% tc_password# label="Neues Passwort" name="new_password" strength=True min_length=12 %} {% tc_password# label="Neues Passwort" name="new_password_rules" strength=True checklist=True min_length=12 %} </div>

JavaScript-API

Ereignis tc-strength (level, score) und toggleVisibility(); Texte als Attribute übersetzbar.

Stärke: –

Code<div class="tc-stack" style="--tc-gap: 12px; max-width: 360px"> <tc-password name="api_password" label="Neues Passwort" strength min-length="12" strength-text="Mindestens 12 Zeichen." label-weak="Schwach" label-medium="Mittel" label-strong="Stark" label-short="noch %(count)s Zeichen bis zur Mindestlänge." show-label="Passwort anzeigen"></tc-password> <p class="tc-text-body-sm tc-text-secondary">Stärke: <span class="tc-mono">–</span></p> <script> (function (root) { root.querySelector('tc-password').addEventListener('tc-strength', event => { root.querySelector('.tc-mono').textContent = (event.detail.level || '–') + ' (' + event.detail.score + '/4)'; }); })(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).
strengthFalse–Show the strength meter and message (sets autocomplete=new-password).
checklistFalse–Show the rule checklist (length, upper/lower case, digit, symbol).
min_length12–Minimum length used by the meter and checklist.

Verwendung

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