Intro

Play Lottie animations in toddle

dotLottie is an open-source file format that aggregates one or more Lottie files and their associated resources into a single file. They are ZIP archives compressed with the Deflate compression method and use the file extension of ".lottie".

Demo

Components

  • dotlotte-player

    dotlottie-player is a simple component for playing lottie animations

    Attributes

    NameTypeDescription
    srctextREQUIREDUrl to the .lottie file
    autoplaybooleanStart playing immidiately
    loopbooleanLoop the animation
    countnumberNumber of loops theĀ  animation should play before stopping
    hoverbooleanPlay on mouse over
    speednumberPlayback speed. 1.0 is normal speed
    playmode"normal" or "bounce"Play normal or bounce animation
    direction1 or -1Set the direction of animation
    intermissionnumberPause for n millliseconds between each loop of the animation.

    Events

    NameDescription
    readyAnimation is ready to play
    completeAnimation is done playing
    pauseAnimation paused
    loopCompleteAnimation is completed a loop
    stopAnimation stopped
    freezeAnimation is frozen
    frameAnimation entered a new frame
    errorAn animation source cannot be parsed, fails to load, or has format errors

Style variables

The following style variables can be used to customize the styling of the player.
Add these to your project theme or as component style variables to override the default values.

dotlottie-player-toolbar-height
Toolbar height
dotlottie-player-toolbar-background-color
Toolbar background color
dotlottie-player-toolbar-icon-color
Toolbar icon color
dotlottie-player-toolbar-icon-hover-color
Toolbar icon hover color
dotlottie-player-toolbar-icon-active-color
Toolbar icon active color
dotlottie-player-seeker-track-color
Seeker track color
dotlottie-player-seeker-thumb-color
Seeker thumb color