From CDN

We recommend using the one of the modern code distribution services, such as:

Inserting the following code into the <head> section of your HTML document:

<script src="{{__BLOCKS_VERSION__}}/web/blocks.min.js" type="module"></script>

or import it directly into your JavaScript code:

<script type="module">
    import * as LR from "{{__BLOCKS_VERSION__}}/web/blocks.min.js";

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.

<script src="{{__BLOCKS_VERSION__}}/web/blocks.iife.min.js" async></script>

From NPM

Install the npm package:

npm i --save-exact @uploadcare/blocks
  • ⚠️ We don’t follow SemVer during the beta phase. That means that we may introduce changes that break existing features and functionality. It’s important to pin your version and read the changelog before updating.

Then you can use the File Uploader and build your own solutions from the source code:

import * as LR from '@uploadcare/blocks'


React Uploader

This library allows you to easily integrate the Uploadcare File Uploader into your React applications:

npm i @uploadcare/react-uploader

Dynamic script connection

There is an alternative way if your project meets the following criteria:

  • Does not support new language features (such as nullish coalescing operator, static class properties) — for instance, this might apply to projects built with frameworks such as Nuxt 2. (Note that Nuxt 3 supports modern JavaScript features and works as needed).
  • Has SSR and does not support node conditional exports.

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:

npm i --save-exact @uploadcare/blocks

Then import connectBlocksFrom function to connect the library dynamically and avoid errors:

import { connectBlocksFrom } from '@uploadcare/blocks/abstract/connectBlocksFrom.js';


You may need to implement some logic that depends on connected uploader or get access directly to the imported components. Since connectBlocksFrom returns Promise, use .then()

import "@uploadcare/blocks@{{__BLOCKS_VERSION__}}/web/lr-file-uploader-regular.min.css";

import { connectBlocksFrom } from '@uploadcare/blocks/abstract/connectBlocksFrom.js';

  (blocks) => {
    if (!blocks) {
      return; // To avoid errors in SSR case

    // Now you can realize your logic, e.g.:
    const uploader = new blocks.FileUploaderRegular();

Choose a solution

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:

Regular mode<lr-file-uploader-regular> </lr-file-uploader-regular>
Inline mode<lr-file-uploader-inline> </lr-file-uploader-inline>
Minimal mode<lr-file-uploader-minimal> </lr-file-uploader-minimal>

Look at the File Uploader solutions for more.


<link rel="stylesheet" href="{{__BLOCKS_VERSION__}}/web/lr-file-uploader-regular.min.css" />



The <lr-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 wire blocks together. Required.