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
- Lottie-web (Official)
- react-lottie (chenqingspring)
- lottie-react-web (felippenardi)
- lottie-react (gamote)
- lottie-react (LottieFiles)
- react-lottie-player (mifi)
- lottie-interactivity
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)
Built Distribution
Close
Hashes for streamlit_lottie-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e15aba8b8879a7483cc8e6bd81b8b7026d50c64fb92af7f0b5e9ce92e719efc3 |
|
MD5 | 66901a41e93ccce84c8771cd650d83bd |
|
BLAKE2b-256 | e3f5d835737edd63b3bbb5e7e00ff1caa2ab9359c5a606d782324cc3d7b0ce41 |