🔥 Black Friday: Up to 50% Off All Plans
Days
Hrs
Min
Sec

Need Help?

Here are some good places you cant start.

Whats New?

Get updated about all the good stuff!

wordpress-black-friday-deals-2025
Unlimited Elements for Elementor – Version 2.0
Unlimited Elements for Elementor – Version 2.0

ES6 Modules in Widget Creator

ES6 modules let you split the JavaScript of a widget into separate files. This keeps the Javascript tab short, lets you reuse the same code in several widgets, and lets you use libraries that come only as ES6 modules. When the same widget is on a page more than once, the browser loads each module file only once.

There are three ways to use a module: include it on the js/css Includes tab, import it at the top of the Javascript tab, or import it from your code when you need it.

Step 1

Open your widget in the widget creator. On the Assets tab, set an assets folder for the widget and upload your module file to it. To learn how, see Assets.

Step 2

To include the module file, open the js/css Includes tab. Under Choose From Browser, select the checkbox next to the file, so it is added to Js Includes.

assets includes

Click the Include Settings (gear) icon next to the file, select Include as ES6 module and click Update. The file is now loaded as a module.

es6 include settings

Step 3

To import a module at the top of your code, open the Javascript tab and select load as module below the code editor. Then write the import on the first line. You can use {{uc_assets_url}} for the URL of the assets folder:

				
					import { myFunction } from "{{uc_assets_url}}my-module.js";

myFunction();
				
			
js code examples link

Step 4

To import a module only when you need it, use the import() function in your code. This works with or without load as module:

				
					import("{{uc_assets_url}}my-module.js").then(function(module){

	module.myFunction();

});
				
			

Click Update to save the widget.

Hurray!

You got FREE access to the worlds leading widgets for Elementor page builder!

Download is just a click away

Get instant access to tons of Elementor goodies, completely FREE!