Website Building » Elementor » How do I create a custom Elementor widget?

How do I create a custom Elementor widget?

Last updated on December 20, 2022 @ 2:04 pm

Creating a custom Elementor widget is easy. All you need is a bit of code and a little know-how about HTML and CSS. Here’s how to do it:

1. Start by creating a new HTML file and naming it widget.html.

2. In the widget.html file, add the following code:

Widget

<div id=”widget”></div>
<script src=”widget.js”></script>

3. Next, in your widget.js file, add the following code:

var $ = jQuery;

$.widget({
name: “Widget”,
template: “widget.html”,});

4. Finally, in your widget.html file, add the following code:

5. You’re done! You can now use your new widget in Elementor. Just add the following line to your project’s main.js file:

PRO TIP: This article covers how to create a custom Elementor widget. While this process is fairly simple, it is important to note that custom widgets are not supported by Elementor and may not work with future updates. Use custom widgets at your own risk.

$(document).ready(function() {
$(“#widget”).widget();

6. If you’d like to customize the look and feel of your widget, you can use the following CSS classes to style it:

.Elementor-widget {
/* General styles */
width: 100%;
height: 100%;
background-color: #e9e9e9;
border: 1px solid #ccc;

.Elementor-widget .Elementor-header {
background-color: #fff;
font-size: 16px;

.Elementor-content {
padding: 5px;

.Elementor-tooltip {
border-radius: 10px;

.Elementor-label {
display: inline-block;
font-size: 12px;

7. Finally, you can add a custom CSS file to your project to style your widget even more. You can find this file in the /assets/css folder. Simply name it widget.css and add the following code to it:

8. You’re done! You can now use your new custom widget in Elementor.

Dale Leydon

Dale Leydon

Sysadmin turned Javascript developer. Owner of 20+ apps graveyard, and a couple of successful ones.