File upload

Drop files on the zone or browse for them. The component checks the type, size and count, previews images, shows each file with its size and status, and uploads them with progress.

Features10APIThemingAccessibility

Basic

One file at a time: the picked file takes the place of the zone, with Replace and Remove. accept and maxFileSize check it, description tells the user the rules.

Drop a file here or browse CSV, up to 10 MB

Selected: nothing yet

Multiple

With multiple the zone stays and the files collect in a list below it, images with a preview. fileLimit caps the count.

Drop files here or browse Up to 5 files of any type

Upload

customUpload hands the files to uploadHandler with progress, complete and fail callbacks — here a simulated server that refuses PDF files. Use url to send them as a FormData request instead.

Drop files here or browse Add a few files and press Upload — PDF files fail

Auto

auto uploads the files as soon as they are picked — no Upload button.

Drop files here or browse Images upload right away

Validation

Files that break accept, maxFileSize or fileLimit are not added; the reasons show under the zone and come out of rejected — here also as a toast.

Drop files here or browse PNG, JPEG or PDF, up to 1 MB, at most 3 files

Basic mode

mode="basic" is a button with the chosen file name next to it — for a profile photo or an attachment field.

No file chosen
No file chosen

Form

A form control: the value is the File (or File[] with multiple). Inside tx-field the hint and the error describe the drop zone.

Drop a file here or browse Signed PDF
No file yet

Templates

txFileUploadDropzone replaces the content of the empty zone, txFileUploadFile draws each file — here as chips.

Add photos to the album

Disabled

disabled turns off the zone, the dialog and dropping.

Drop a file here or browse Uploads are paused during maintenance

Design tokens

dt changes one upload — here a compact zone with a solid primary outline and round corners.

Drop files here or browse Any file