Zustände
Ablagefläche in Standard, Fehler, Laden, Limit und deaktiviert.
PDF oder PDF/A · max. 50 MB
Datei zu groß: bericht.pdf hat 62 MB, erlaubt sind 50 MB.
PDF oder PDF/A · max. 50 MB
PDF oder PDF/A · max. 50 MB
Formulare
Drop zone with file list (Figma: File Upload, File Item), form-associated <tc-file-upload>: submits the selected or dropped files under name (multipart forms and HTMX forms). The list consists of <tc-file-upload-item> children. With upload_url every file is posted immediately (field name name, CSRF header) with a progress bar; the response HTML (e.g. {% tc_file_upload_item# %} with input_name and value) replaces the list entry. Events: change, tc-change, tc-upload, tc-upload-error, tc-remove.
Ablagefläche in Standard, Fehler, Laden, Limit und deaktiviert.
PDF oder PDF/A · max. 50 MB
Datei zu groß: bericht.pdf hat 62 MB, erlaubt sind 50 MB.
PDF oder PDF/A · max. 50 MB
PDF oder PDF/A · max. 50 MB
Ablageflächen in SM (ohne Icon), MD und LG.
max. 10 MB
max. 10 MB
Bis zu 5 Dateien, je max. 10 MB
Upload mit Fortschritt, erfolgreich geprüfte Datei und Fehler als tc-file-upload-item.
PDF oder PDF/A · max. 50 MB
tc-file-upload sendet die Dateien als Formularwert (multipart); vorhandene Dateien als tc-file-upload-item.
| 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 | 'file' | – | Form field name. |
multiple | False | – | Allow several files. |
accept | '' | – | Accepted types, e.g. ".pdf,application/pdf". |
instruction | '' | – | Drop instruction, default "Drag files here or". |
action | '' | – | Link text that opens the file dialog, default "choose file". |
drop_text | '' | – | Text while dragging over the zone, default "Release to upload". |
size | 'md' | Zone height: sm 88 (no icon), md 136, lg 200 px. | |
icon | 'upload' | – | Carbon icon in the zone. |
disabled | False | – | Disable the upload. |
loading | False | – | Show the processing state (spinner) instead of the instruction. |
loading_text | '' | – | Text of the processing state, default "Checking files …". |
max_files | 0 | – | Maximum number of files; the zone is locked when reached (0 = no limit). |
max_size | 0 | – | Maximum size per file in bytes, checked in the browser (0 = no limit). |
upload_url | '' | – | Endpoint for immediate uploads with progress (POST, multipart). |
files | '()' | – | Existing files: dictionaries with name, size, status, detail, progress. |
One entry of the file list (Figma: File Item), e.g. as response of an upload endpoint.
| Option | Standard | Werte | Beschreibung |
|---|---|---|---|
name | 'Dokument.pdf' | – | File name. |
size | '' | – | Size in bytes or preformatted text. |
status | 'done' | Uploading (progress bar), done or error. | |
detail | '' | – | Detail line, e.g. a validation result or error message. |
progress | 0 | – | Upload progress in percent. |
url | '' | – | Link to the stored file. |
removable | True | – | Show the remove button. |
input_name | '' | – | Name of a hidden input that keeps the stored file reference. |
value | '' | – | Value of the hidden input (e.g. the stored file id). |
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.