

Every state


default


focus


preview


mapping-error


importing


done


disabled
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| id | string | "csv" | Id prefix for the error. |
| name | string | "csv" | Form field name of the file input. |
| fields | FileUploadCsvField[] | – | The fields a column can map to: key, label, required. Defaults to name, email and phone. |
| noun | string | "contact" | What one row is, for the counts and the button. |
| accept | string | ".csv,text/csv" | Allowed file types. |
| maxSize | number | 5242880 | The largest file in bytes. |
| previewRows | number | 4 | How many rows the preview table shows. |
| defaultFile | { name: string; text: string } | – | A CSV to start with, shown as if just picked. |
| defaultStatus | "idle" | "importing" | "done" | – | Start in importing or done (needs defaultFile). |
| onImport | (rows, mapping) => void | Promise<void> | – | Receives the rows as objects keyed by field, and the column-to-field mapping. Throw to show an error. |
| error | string | – | A message above the Import button. |
| disabled | boolean | – | Disables the picker, the selects and the button. |
| className | string | – | Extra classes on the wrapper. |
More file uploads
All 12file-upload-04 is in UI ProGet UI Pro, €199


