Function defineElement

  • Helper method that defines the lord-icon custom element with pre-made triggers and a player factory.

    This method defines the following triggers:

    Example of tag definition with the default setup:

    import lottie from 'lottie-web';
    import { defineElement } from '@lordicon/element';

    defineElement(lottie.loadAnimation);

    Basic usage from markup which is possible after tag definition:

    <lord-icon trigger="hover" src="/icons/confetti.json"></lord-icon>
    

    Parameters

    • animationLoader: AnimationLoader

      Use loadAnimation from the lottie-web package.

    Returns void