Skip to content

Properties

PropertyTypeDescription
idstring
Function
Object
React.Context
(optional) Unique id used with the useUpload hook to manage the files. Needed when wanting to connect with the useUpload hook.
acceptedFileTypesArray<string>
Array<AcceptedFileType>
(required) List of accepted file types. Either as string or AcceptedFileType. When providing a list of AcceptedFileType, the accepted file types will be presented in a table(see example).
filesAmountLimitnumber(optional) Defines the amount of files the user can select and upload. Defaults to 100.
fileMaxSizenumber
false
(optional) Defines the max file size of each file in MB. Use either 0 or false to disable. Defaults to 5 MB.
titlestring(optional) Custom text property. Replaces the default title. Can be disabled using false.
textstring(optional) Custom text property. Replaces the default text. Can be disabled using false.
downloadboolean(optional) Causes the browser to treat all listed files as downloadable instead of opening them in a new browser tab or window. Defaults to false.
skeletonboolean(optional) Skeleton should be applied when loading content.
Spacestring
object
(optional) Spacing properties like top or bottom are supported.

AcceptedFileType

The accepted file type object is used to define file max size for specific file types.

When providing a list of AcceptedFileType to Uploads acceptedFileTypes, the accepted file types will be presented in a table. Here is an example.

The table is sorted descending by maxFileSize. Multiple fileType for the same maxFileSize is sorted alphabetically ascending by fileType.

PropertyTypeDescription
fileTypestring(required) The name of the accepted file type.
fileMaxSizenumber
false
(optional) Defines the max file size of the given file type in MB. Use either 0 or false to disable. If not provided, it defaults to the value of Uploads fileMaxSize which defaults to 5 MB.

Translations

All translation keys listed in the translations table below, can be used as a component property (like title or text).

More info about translations can be found in the general localization and Eufemia Forms localization docs.

Keynb-NOen-GBsv-SE (beta)
Upload.titleLast opp dokumenterUpload documentsLadda upp dokument
Upload.textDra og slipp eller velg hvilke filer du vil laste opp.Drag & drop your files or choose files to upload.Dra och släpp eller välj vilka filer du vill ladda upp.
Upload.textSingularDra og slipp eller velg hvilken fil du vil laste opp.Drag & drop your file or choose which file to upload.Dra och släpp eller välj vilken fil du vill ladda upp.
Upload.fileTypeTableCaptionTillatte filformater og maks filstørrelseAllowed formats and max. filesizeTillåtna filformat och max filstorlek
Upload.fileTypeDescriptionTillatte filformater:Allowed formats:Tillåtna filformat:
Upload.fileSizeDescriptionMaks filstørrelse:Max. filesize:Max filstorlek:
Upload.fileAmountDescriptionMaks antall filer:Max. number of files:Max antal filer:
Upload.fileSizeContent%size MB%size MB%size MB
Upload.buttonTextVelg filerChoose filesVälj filer
Upload.buttonTextSingularVelg filChoose fileVälj fil
Upload.loadingTextLasterLoadingLaddar
Upload.errorLargeFileFilen du prøver å laste opp er for stor, den maksimale støttede størrelsen er %size MB.The file you are trying to upload is too big, the maximum size supported is %size MB.Filen du försöker ladda upp är för stor, den maximalt tillåtna storleken är %size MB.
Upload.errorAmountLimitDet er begrenset hvor mange filer du kan laste opp (%amount).There is a limit to how many files you can upload (%amount).Det är begränsat hur många filer du kan ladda upp (%amount).
Upload.errorUnsupportedFileFilen du prøver å laste opp er ikke støttet.The file you are trying to upload is not supported.Filen du försöker ladda upp stöds inte.
Upload.deleteButtonSlettDeleteRadera
Upload.fileListAriaLabelopplastede fileruploaded filesuppladdade filer
Upload.errorRequiredDu må laste opp minst en fil.You must upload a file.Du måste ladda upp minst en fil.
Upload.errorInvalidFilesFjern alle filer som har feil.Remove all files that have errors.Ta bort alla filer som innehåller fel.