Media · Gutenberg

Lottie Animation block for WordPress

Play a Lottie JSON animation with trigger modes: autoplay, hover, click or scroll.

Get Blockenberg

Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.

Get Blockenberg

What it actually does

Play a Lottie JSON animation with trigger modes: autoplay, hover, click or scroll.

Inspector panels on this block: Animation Source, Playback, Size & Layout. Those titles come from index.js, not from a shared template.

Behavior controls: “Lottie JSON URL” (Enter the URL of a Lottie JSON file (e.g. from LottieFiles.com)); “Play Trigger” options: Autoplay, On Hover, On Click, On Scroll into View; “Direction” options: Forward, Reverse; “Size & Layout — Alignment” options: Left, Center, Right.

Where to find it

Gutenberg inserter → Media → search “Lottie Animation” (block name `blockenberg/lottie` in block.json). Style it in the sidebar after insert.

How to use Lottie Animation block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Lottie Animation”, insert it. Category: Media.
  3. Configure inspector controls that exist on this block. Open Animation Source. Set “Lottie JSON URL”, “Play Trigger”, “Loop”, “Speed”.
  4. Check the published page. The view script reads HTML data attributes: data-direction, data-keep-frame, data-loop, data-speed, data-trigger. The block editor preview may not run the same view script.

Inspector controls from this block’s code

ControlWhat the code does
Lottie JSON URLText field in the inspector. Enter the URL of a Lottie JSON file (e.g. from LottieFiles.com). Saved as `lottieUrl`.
Play TriggerSelect control; the chosen value is saved on the block. Options: Autoplay; On Hover; On Click; On Scroll into View. block.json default: autoplay. Saved as `playTrigger`.
LoopOn/off toggle in the inspector. On by default. Saved as `loop`.
SpeedNumeric range control in the inspector. Range 0.1–4. block.json default: 1. Saved as `speed`.
DirectionSelect control; the chosen value is saved on the block. Options: Forward; Reverse. block.json default: 1. Saved as `direction`.
Freeze on Last FrameOn/off toggle in the inspector. Off by default. Saved as `keepLastFrame`.
Full container widthOn/off toggle in the inspector. Off by default. Saved as `autoWidth`.
Width (px)Numeric range control in the inspector. Range 80–1200. block.json default: 400. Saved as `width`.
Auto height (preserve ratio)On/off toggle in the inspector. On by default. Saved as `autoHeight`.
Height (px)Numeric range control in the inspector. Range 80–1000. block.json default: 400. Saved as `height`.
Size & Layout — AlignmentSelect control; the chosen value is saved on the block. Options: Left; Center; Right. block.json default: center. Saved as `align`.
Border Radius (px)Numeric range control in the inspector. Range 0–60. block.json default: 0. Saved as `borderRadius`.
Padding (px)Numeric range control in the inspector. Range 0–80. block.json default: 0. Saved as `padding`.

What the front-end script actually does

When this is the right block

Notes from the implementation

viewScript: this folder’s frontend.js is enqueued on the front end for this block.

FAQ

How do I add the Lottie Animation block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Lottie Animation”. It sits under Media. After insert, open Animation Source and set “Lottie JSON URL”, “Play Trigger”, “Loop”, “Speed”.

What makes Lottie Animation different from other Blockenberg blocks?

Play a Lottie JSON animation with trigger modes: autoplay, hover, click or scroll. Inspector labels on this block include “Lottie JSON URL”, “Play Trigger”, “Loop”, “Speed”.

Is the Lottie Animation Gutenberg block free?

Yes. Lottie Animation ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style Lottie Animation to match my theme?

Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Animation Source, Playback, Size & Layout).

Related media blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Lottie Animation from the Gutenberg inserter.

Get Blockenberg