Using Streamlit Components – streamlit-lottie
As we talked about at the beginning of this chapter, lottie
is a web-native, open source library created by Airbnb to make putting animations on your website just as easy 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.
To do this, 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...