

Every state


default


focus


link-tab


link-error


importing


done


disabled
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| id | string | "source-file" | Id of the file input; related ids are built from it. |
| name | string | "source-file" | Form field name of the file input. |
| label | string | "Add a file" | The visible label above the tabs. |
| accept | string | ".pdf,.docx,.csv,.png,.jpg" | Accepted types, as the file picker takes them. Its extensions also check a link. |
| acceptLabel | string | "PDF, Word, CSV, PNG or JPG" | The accepted types in words, for the hint and messages. |
| maxSize | number | 26214400 | Largest file from the device, in bytes. |
| defaultTab | "device" | "link" | "device" | Which tab is open at the start. |
| defaultUrl | string | – | The link in the field at the start. |
| defaultError | string | – | An error under the link field at the start. |
| defaultFile | FileUploadLinkFile | – | The file in the row at the start: name, size, source (device or link), host, status (importing or done). |
| disabled | boolean | – | Disables the tabs, the field and every action. |
| importUrl | FileUploadLinkImport | – | Your import call (url, { signal }), resolving with { name, size }. The default is a local simulation; a link containing "fail" fails. |
| onFileChange | (file: FileUploadLinkFile | null) => void | – | Called when the file in the row is added, imported or removed. |
| className | string | – | Extra classes on the wrapper. |

