DotLottie in Elementor

I wanted to know is there any way I can use Dotlottie (.lottie) in Elementor wordpress website? I am using Elementor Pro and able to use json in it but want use Dotlottie to decrease the size of my file

Hi @capstone8521

I’ve checked this with our engineer and here’s his answer:

I couldn’t find how to do it with Elementor so I reverted to the original Wordpress editor (which that person can do too normally), these are the steps to take to use dotLottie:

  1. Add custom code, for this part, I installed this plugin to make it easier: Simple Custom CSS and JS – WordPress plugin | WordPress.org English (UK)

  2. I added the dotLottie CDN to the header of my page using the plugin:

  3. In the block editor I used the dotLottie-player as indicated via the dotLottie docs using a custom html block:


<figure class="wp-block-image size-full">
<dotlottie-player
  autoplay
  controls
  loop
  mode="normal"
  src="https://assets2.lottiefiles.com/dotlotties/dlf10_l12sw9oo.lottie"
  style="width: 320px"
>
</dotlottie-player></figure>