How to use lottie animation as background for a streamlit app

Summary

I am developing a chatbot application using Streamlit and I want to add a Lottie animation as an background. I don’t think this is possible though so what I want to know is if I can convert the animation to some other format and use that as my background?

Steps to reproduce

Code snippet:

url = requests.get(
    "https://assets5.lottiefiles.com/packages/lf20_q8ND1A8ibK.json")
# Creating a blank dictionary to store JSON file,
# as their structure is similar to Python Dictionary
url_json = dict()
  
if url.status_code == 200:
    url_json = url.json()
else:
    print("Error in the URL")
  
  
st.title("Adding Lottie Animation in Streamlit WebApp")
  
st_lottie(url_json)

Debug info

  • Streamlit version: 1.22.0
  • Python version: 3.10.11
  • OS version: Windows 10
  • Browser version: Google Chrome 113.0.5672.127

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.