

Every state


default


focus


attached


uploading


error


disabled
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| id | string | "attach" | Id prefix for the hint and error. |
| name | string | "attachments" | Form field name of the file input. |
| label | string | "Attach files" | The button text. |
| accept | string | ".pdf,.doc,.docx,image/*" | Allowed types, as in the accept attribute; checked before upload. |
| hint | string | "PDF, Word or image, up to 10 MB" | A short note on the allowed files, beside the count. |
| maxSize | number | 10485760 | The largest file in bytes. |
| maxFiles | number | 5 | How many files can be attached. |
| defaultFiles | FileUploadAttachFile[] | [] | Files already attached: name, size, type, status, progress, error. |
| upload | (file, { onProgress, signal }) => Promise<void> | – | Sends one file. The default is a local simulation that fails for names containing "fail". |
| error | string | – | A message under the row; marks the button invalid. |
| disabled | boolean | – | Disables the button and the chips. |
| onFilesChange | (files: FileUploadAttachFile[]) => void | – | Called when files are added, finished, failed or removed. |
| className | string | – | Extra classes on the wrapper. |
More file uploads
All 12file-upload-01 is in UI ProGet UI Pro, €199

