Skip to main content

A Streamlit custom component to load Lottie animations

Project description

Streamlit Lottie

Integrate Lottie animations inside your Streamlit app!

Install

pip install streamlit-lottie

Usage

from streamlit_lottie import st_lottie

def load_lottieurl(url: str):
    r = requests.get(url)
    if r.status_code != 200:
        return None
    return r.json()

lottie_url = "https://assets5.lottiefiles.com/packages/lf20_V9t630.json"
lottie_json = load_lottieurl(lottie_url)
st_lottie(lottie_json)

Development

Install

  • JS side
cd frontend
npm install
  • Python side
conda create -n streamlit-echarts python=3.7
conda activate streamlit-echarts
pip install -e .

Run

Both webpack dev server and Streamlit need to run for development mode.

  • JS side
cd frontend
npm run start
  • Python side
streamlit run app.py

References

Credits Lottie files:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

streamlit-lottie-0.0.1.tar.gz (155.2 kB view hashes)

Uploaded Source

Built Distribution

streamlit_lottie-0.0.1-py3-none-any.whl (11.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page