We recommend using one of the modern code distribution services, such as:
Import the File Uploader library into your JavaScript code:
Note that we distribute the library as ES modules, so you need to use the type="module" attribute on the <script> tag.
We’re also providing IIFE bundle, but it’s not recommended to use it directly.
Install the npm package:
Then register the File Uploader components for usage:
This library allows you to easily integrate the File Uploader into your React applications:
Ready-to-run examples are available in our examples repository:
For setup paths by framework, see framework integrations.
There is an alternative way if your project meets the following criteria:
Then you can use this workaround to import the uploader only at the browser runtime, bypassing your project’s build system and obtaining a working type system. This can be achieved without the need to manually configure the build process (using tools such as Babel) or disabling SSR for a specific package.
First, install the npm package:
Then import loadFileUploaderFrom function to connect the library dynamically and
avoid errors:
You may need to implement some logic that depends on connected uploader or get
access directly to the imported components. Since loadFileUploaderFrom returns
Promise, use .then()
To use the File Uploader in your application markup, select the tag that best fits your needs from the table below and place it in your HTML document:
Look at the File Uploader solutions for more.
Example:
The <uc-config> block is used to configure the uploader. Take a look at
uploader configuration.
The ctx-name attribute is used to specify the name of the uploader context,
which allows blocks to be wired together. Required.
The dynamic-button attribute can be used with the Regular File Uploader to
replace the default static upload button with a compact, state-aware control. It
shows configured upload sources, accepts drag and drop, and changes after files
are selected, uploaded, or failed.
See Dynamic button for view modes, behavior, and use cases.
The headless attribute can be used with the Regular File Uploader to hide the default upload button. This is useful when you want to replace the default button with your own custom UI element and trigger the upload flow programmatically.
When headless mode is enabled, use the initFlow() method to start the upload process:
Note:
All examples assume you have configured your API keys. ReplaceYOUR_PUBLIC_KEYwith your actual public key, or set it via environment variables. The component must be defined before callinginitFlow().