Skip to content

Properties

Field-specific properties

PropertyTypeDescription
fileHandlerfunction(optional) File handler function that takes newly added files (newFiles: UploadValue) as a parameter and returns the processed files. The function can either be synchronous or asynchronous. It returns a promise (Promise<UploadValue>) containing the processed files when asynchronous.
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.
childrenReact.ReactNode(optional) Content to display below the title and text. Can be used to add custom content.
variantnormal
compact
(optional) defines the appearance. Use one of these: normal or compact. Defaults to normal.
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.
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.
allowDuplicatesboolean(optional) Allows uploading of duplicate files. Defaults to false.
disableDragAndDropboolean(optional) Disables file drag and drop, by removing the drop zone. Defaults to false.
buttonPropsButtonProps(optional) Define any valid Eufemia Button properties or HTML attribute inside an object, to customize the upload button behavior and appearance.
skeletonboolean(optional) Skeleton should be applied when loading content.
Spacestring
object
(optional) Spacing properties like top or bottom are supported.

General properties

PropertyTypeDescription
valueArray<{ file, id }>(optional) Source data value for the field. Will take precedence over the path value given in the data context.
defaultValueArray<{ file, id }>(optional) Default source data value for the field. Will not take precedence over the path value given in the data context.
pathstring(optional) JSON Pointer for where the data for the field is located in the source dataset (when using Form.Handler or DataContext). The path will also be set as the name attribute for the string-field.
infoReact.Node
Array<React.Node>
function
(optional) Info message shown below / after the field. When provided as a function, the function will be called with the current value as argument. The second parameter is an object with { conditionally, getValueByPath, getFieldByPath }. To show the message first after the user has interacted with the field, you can call and return conditionally function with a callback and with options: conditionally(() => 'Your message', { showInitially: true })
warningReact.Node
Array<React.Node>
function
(optional) Warning message shown below / after the field. When provided as a function, the function will be called with the current value as argument. The second parameter is an object with { conditionally, getValueByPath, getFieldByPath }. To show the message first after the user has interacted with the field, you can call and return conditionally function with a callback and with options: conditionally(() => 'Your message', { showInitially: true })
errorError
FormError
Array<Error | FormError>
function
(optional) Error message shown below / after the field. When provided as a function, the function will be called with the current value as argument. The second parameter is an object with { conditionally, getValueByPath, getFieldByPath }. To show the message first after the user has interacted with the field, you can call and return conditionally function with a callback and with options: conditionally(() => 'Your message', { showInitially: true })
disabledboolean(optional) Set true to show the field but without the possibility of changing the value.
emptyValueArray<{ file, id }>
undefined
(optional) The value to use (in onChange events etc) when emptying the field. Makes it possible for instance to provide undefined instead of an empty string when clearing the content of a text input.
requiredboolean(optional) When set to true, the field will give an error if the value fails the required validation. When set to false, the field will not be required, but will add a "(optional)" suffix to the label.
schemaobject(optional) Custom JSON Schema for validating the value.
validateInitiallyboolean(optional) Set to true to show validation based errors initially (from given value-prop or source data) before the user interacts with the field.
validateUnchangedboolean(optional) Set to true to show validation based errors when the field is touched (like focusing a field and blurring) without having changed the value. Since the user did not introduce a new error, this will apply when the value was initially invalid based on validation.
validateContinuouslyboolean(optional) Set to true to show validation based errors continuously while writing, not just when blurring the field.
errorMessagesobject(optional) Custom error messages for each type of error, overriding default messages. The messages can be a React.ReactNode or a string.
transformInfunction(optional) Transforms the value before its displayed in the field (e.g. input).
transformOutfunction(optional) Transforms the value before it gets forwarded to the form data object (context) or returned as the onChange value parameter. The first parameter is the internal value. Some fields do support a second parameter, like the SelectCountry, where the country object is given.
labelstring(optional) Field label to show above / before the input feature.
labelDescriptionstring(optional) A more discreet text displayed beside the label (i.e for "(optional)").
helpobject(optional) Provide help content for the field using title and content as a string or React.Node. Additionally, you can set open to true to display the inline help, set the breakout property to false to disable the breakout of the inline help content, or use renderAs set to dialog to render the content in a Dialog (recommended for larger amounts of content).
widthstring
false
(optional) Will set the width for the whole block. Use small, medium, large for predefined standard widths. You can also set a custom width {number}rem or use stretch or false.
Spacestring
object
(optional) Spacing properties like top or bottom are supported.

Translations

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

Keynb-NOen-GBsv-SEda-DK
Upload.titleLast opp dokumenterUpload documentsLadda upp dokumentUpload dokumenter
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.Træk og slip eller vælg hvilke filer du vil uploade.
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.Træk og slip eller vælg hvilken fil du vil uploade.
Upload.fileTypeTableCaptionTillatte filformater og maks filstørrelseAllowed formats and max. file sizeTillåtna filformat och max filstorlekTilladte filformater og maks filstørrelse
Upload.fileTypeDescriptionTillatte filformater:Allowed formats:Tillåtna filformat:Tilladte filformater:
Upload.fileSizeDescriptionMaks filstørrelse:Max. file size:Max filstorlek:Maks filstørrelse:
Upload.fileAmountDescriptionMaks antall filer:Max. number of files:Max antal filer:Maks antal filer:
Upload.fileSizeContent%size MB%size MB%size MB%size MB
Upload.buttonTextVelg filerChoose filesVälj filerVælg filer
Upload.buttonTextSingularVelg filChoose fileVälj filVælg fil
Upload.loadingTextLasterLoadingLaddarIndlæser
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.Filen du prøver at uploade er for stor, den maksimale understøttede størrelse er %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).Der er en grænse for, hvor mange filer du kan uploade (%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.Filen du prøver at uploade er ikke understøttet.
Upload.deleteButtonSlettDeleteRaderaSlet
Upload.fileListAriaLabelopplastede fileruploaded filesuppladdade fileruploadede filer
Upload.errorRequiredDu må laste opp minst en fil.You must upload a file.Du måste ladda upp minst en fil.Du skal uploade mindst én fil.
Upload.errorInvalidFilesFjern alle filer som har feil.Remove all files that have errors.Ta bort alla filer som innehåller fel.Fjern alle filer, der indeholder fejl.