Zustände
Eingabefelder in den Zuständen Standard, Platzhalter, Fehler, Erfolg, Warnung, deaktiviert und schreibgeschützt.
Formulare
Single-line text field (Figma: Input), form-associated <tc-input>. Label above, hint or error below; states Default, Hover, Focus, Error, Success, Warning, Disabled and Read-only. Passthrough attributes such as maxlength, pattern, autocomplete, inputmode and HTMX shorthands stay on the host; the native constraints are mirrored to the inner <input>.
Eingabefelder in den Zuständen Standard, Platzhalter, Fehler, Erfolg, Warnung, deaktiviert und schreibgeschützt.
SM, MD und LG passen zur Höhe der Buttons in derselben Zeile.
Pflichtfeld, optional, Label-Icon mit Tooltip, Icons, Löschen-Button und Zeichenzähler.
tc-input ohne Template-Tag, z. B. aus JavaScript oder HTMX-Antworten; der Browser baut das Shadow DOM selbst.
Eigenschaften value und error, Ereignisse tc-input, tc-change und tc-clear.
Letztes Ereignis: –
| Option | Standard | Werte | Beschreibung |
|---|---|---|---|
label | '' | – | Visible label text. |
required | False | – | Mark as required: native required attribute plus a red asterisk. |
optional | False | – | Show the "optional" marker after the label (ignored when required). |
label_icon | '' | – | Explanation shown as a help icon with tooltip after the label. |
hide_label | False | – | 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. |
disabled | False | – | Disable the control. |
readonly | False | – | 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. |
clearable | False | – | Show a clear button while the field has a value. |
mono | False | – | Monospaced value for technical values (hostnames, IPs, keys). |
counter | False | – | Show a character counter (Figma: Count); combine with maxlength. |
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.