Quick Tip : Lottie-web animation (using Jinja to pass data in a HTML file)

There was a case where I wanted to experiment with Jinja to inject Python data in a HTML file before rendering with components.html.

Today, another use case, inject a Lottie JSON file into the Lottie HTML player, this time I tried Jinja.You should be able to play exported After Effects animations with Lottie in Streamlit now ahah. Maybe even do a loading screen while some computation is in effect :wink: and there’s even a gallery of Lottie files

If someone wants to do a static component package out of it (like for Folium)…

TLDR: use Jinja to pass Python data in a HTML template.

1 Like

Fascinating! The jinja piece is more exciting to me than Lottie itself, glad to see it’s so easy to incorporate jinja :partying_face:

1 Like