Partial Component

Lottie

The Lottie partial integrates Lottie animations into components. It loads the Lottie player library and creates an animation player with configurable settings for speed, looping, and autoplay.

Manifest

{
  "name": "lottie",
  "type": "_partials",
  "styles": ["lottie.css"],
  "scripts": [],
  "requires": []
}

Configuration

lottie:
  src: '/assets/lotties/example4.json'
  speed: 1
  control:
    autoplay: true
    loop: true

Configuration Options

PropertyTypeRequiredDefaultDescription
srcstringYes-Path to Lottie JSON file
speednumberNo1Animation playback speed
control.autoplaybooleanNofalseStart playing automatically
control.loopbooleanNofalseLoop the animation

Example

Usage in Templates

{% from "components/_partials/lottie/lottie.njk" import lottie %}

{{ lottie(section.lottie) }}

Notes

  • Loads Lottie player from CDN
  • Speed, loop, and autoplay configuration
  • Uses the modern lottie-player web component