Using Streamlit Components – streamlit-lottie
Lottie is a web-native, open-source library created by Airbnb to make putting animations on your website just as easily as putting static images on it. It is very common for large, profitable tech companies to put out open-source software as a way of giving back to the developer community (or, more likely, to recruit developers who think their software is cool), and this is no exception. In this case, streamlit-lottie
wraps around lottie
files and places them directly into our Streamlit apps.
Before we try this out for ourselves, we first need to import the streamlit-lottie
library, and then point the st_lottie()
function to our lottie
file. We can either import a local lottie
file or, more likely, we can find a useful animation file on the free site (https://lottiefiles.com/) and load it from there into our app.
To test this out, we can add a cute penguin animation (https://lottiefiles.com/39646-cute-penguin) to the top...