

Every state


default


focus


dragging


uploading


done


error


disabled
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| id | string | "avatar" | Id prefix for the hint and error. |
| name | string | "avatar" | Form field name of the file input. |
| label | string | "Profile photo" | The visible label beside the circle. |
| initials | string | "AK" | Shown in the circle while there is no photo. |
| accept | string | "image/jpeg,image/png" | Allowed image types; checked before upload. |
| maxSize | number | 2097152 | The largest file in bytes. |
| hint | string | "JPG or PNG, up to 2 MB" | A short note on the allowed files. |
| defaultPreview | string | – | The photo to start with, as a URL. |
| defaultStatus | "idle" | "uploading" | – | Start in uploading to draw the ring without a real file. |
| defaultProgress | number | – | 0 to 100, used with defaultStatus uploading. |
| dragging | boolean | – | Draws the circle as if a file is being dragged over it. |
| upload | (file, { onProgress, signal }) => Promise<void> | – | Sends the file. The default is a local simulation that fails for names containing "fail". |
| error | string | – | A message under the row; marks the circle invalid. |
| disabled | boolean | – | Disables the circle and the buttons. |
| onFileChange | (file: File | null) => void | – | Called with the uploaded file, or null when removed. |
| className | string | – | Extra classes on the wrapper. |
More file uploads
All 12file-upload-02 is in UI ProGet UI Pro, €199


