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.2.tar.gz
(895.8 kB
view hashes)
Built Distribution
Close
Hashes for streamlit_lottie-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b61a2cc03935eaa9d652af7307dbd3ab3d9ffbab9b69d5e4924292d1e5f5f0b |
|
MD5 | 0d36c3a1168c1932ccc7481a9ac71ef1 |
|
BLAKE2b-256 | af071290cc43b3dad3ae08dbddcfc946686284739b29acb00bc383bc3588a507 |