Configuration

In the following example, the value property is used in the configuration object to specify the default image value.

import { Uppload } from "uppload";

const uploader = new Uppload({
  value: "https://example.com/image.jpg"
});

The keys you can use in the configuration object are:

KeyTypeDescription
valueStringDefault/current image URL
bindIElementsSet value of these elements
callIElementsClicking on these elements should open modal
defaultServiceStringDefault service to open widget on
langObjectLanguage pack
uploaderFunctionFunction to upload files
inlineBooleanShow widget inline instead of modal
customClassStringAdds an additional class to the container
multipleBooleanAllow multiple file uploads #59
compressionNumberCompress image with this factor (0-1)
compressionFromMimesString[]Only compress these types of images
compressionToMimeStringType of image to return, image/jpeg or image/webp
maxWidthNumberResize image to maximum width
maxHeightNumberResize image to maximum height
maxSizeNumber[]Resize image to maximum [width, height]
compressorFunctionFunction to compress files

*The IElements type can be any of the following: