Skip to content

Configuring CldUploadWidget

Basic Props

Prop Type Example
signatureEndpoint string/api/sign-cloudinary-paramsMore Info
uploadPreset stringmy-upload-presetMore Info

signatureEndpoint

An API endpoint used to sign the parameters generated during upload.

signatureEndpoint = '/api/sign-cloudinary-params';

Find an example of generating a signature on the Signed Uploads page.

Or learn more about generating signatures on the Cloudinary docs.

uploadPreset

uploadPreset = 'my-upload-preset';

Learn more about upload presets on the Cloudinary docs.

Events

Upload Widget events allow you to tap into different points of the upload lifecycle including when an upload has completed, but also when it starts the queue and more.

Events are passed in as props rather than using the on:event syntax:

EventType
onAbort(results, options) => voidMore Info
onBatchCancelled(results, options) => voidMore Info
onClose(results, options) => voidMore Info
onDisplayChanged(results, options) => voidMore Info
onError(error, options) => void
onOpen(widget) => void
onPublicId(results, options) => voidMore Info
onQueuesEnd(results, options) => voidMore Info
onQueuesStart(results, options) => voidMore Info
onRetry(results, options) => voidMore Info
onShowCompleted(results, options) => voidMore Info
onSourceChanged(results, options) => voidMore Info
onSuccess(results, options) => voidMore Info
onTags(results, options) => voidMore Info
onUploadAdded(results, options) => voidMore Info
onUpload(results, widget) => voidDeprecated, use onSuccess

The options object contains the widget and all instance methods.

Slot Props

PropTypeDescription
isLoadingbooleanDesignates whether the upload widget is loading and initializing.
cloudinaryCloudinaryThe Cloudinary instance which creates and manages the Widget instance.
widgetWidgetThe widget instance attached to the current component.
Instance Methodsn/aSee Instance Methods below

Instance Methods

PropTypeDescription
closefunctionCloses and resets the widget to its initial state without removing it from memory.
showfunctionRenders a previously hidden widget.
openfunctionRenders an existing widget currently in memory, but that is not currently displayed.
destroyfunctionHides a previously rendered widget while retaining its current state in memory.
hidefunctionCloses the widget and completely removes it from the DOM. Returns a promise that resolves upon cleanup completion.
minimizefunctionMinimizes the widget.
updatefunctionUpdates a widget currently in memory with new options.
isDestroyedfunctionReturns whether the destroy method was called on this instance.
isMinimizedfunctionReturns whether the widget is currently minimized.
isShowingfunctionReturns whether the widget is currently visible.

Advanced Configuration

Prop Type Default Example
config object-{ url: { cloudName: 'spacejelly' } }More Info
options object {encryption: {...}}More Info

config

Allows configuration for the Cloudinary environment.

Examples

config={{
cloud: {
cloudName: '<Your Cloud Name>',
apiKey: '<Your API Key>'
}
}}

options

Parameters used to customize and configure the Upload Widget instance. These options are passed in directly to the Upload Widget, exposing all available parameters through the options object.

options={{
sources: ['local', 'url', 'unsplash'],
multiple: true,
maxFiles: 5
}}

Learn more about Upload Widget parameters on the Cloudinary docs.