A utility package that styles Streamlit apps according to UNDP Design System. Check out the documentation or explore this live demo app.
Currently, the package is distributed via GitHub only. You can install it with pip
:
pip install git+https://github.com/undp-data/st-undp.git@0.1.0
You can also add it to your requirements.txt
:
st-undp @ git+https://github.com/undp-data/st-undp.git@0.1.0
See VCS Support for more details.
The package is intended to make styling a breeze. The most basic usage involves only two simple steps.
First, use the CLI to set up the recommended theme in .streamlit/config.toml
:
python -m st_undp configure
This will edit the theme section in the file if it exists or create it if it doesn't.
Then, call apply_style
function inside your application entry point, typically app.py
:
import st_undp
import streamlit as st
st_undp.apply_style()
st.title("Hello world!") # now UNDP-styled
This package is currently in the early stages of development. Main features include:
ProximaNova
fonts- CSS styles for most Streamlit input components
- Several custom components from the UNDP Design System, such as Author, Footer, Header, Stats Card
- No additional dependencies on top of what is required by
streamlit
All contributions must follow Conventional Commits.
The codebase is formatted with black
and isort
. Use the provided Makefile for these
routine operations.
- Clone or fork the repository
- Create a new branch (
git checkout -b feature-branch
) - Make your changes
- Ensure your code is properly formatted (
make format
) - Commit your changes (
git commit -m 'Add some feature'
) - Push to the branch (
git push origin feature-branch
) - Open a pull request
This project is licensed under the BSD 3-Clause License. However, entities or individuals not affiliated with UNDP are strictly prohibited from using this package or any of its components to create, share, publish, or distribute works that resemble, claim affiliation with, or imply endorsement by UNDP.
UNDP’s name, emblem and its abbreviation are the exclusive property of UNDP and are protected under international law. Their unauthorized use is prohibited, and they may not be reproduced or used in any manner without UNDP’s prior written permission.
This project is part of Data Futures Exchange (DFx) at UNDP. If you are facing any issues or would like to make some suggestions, feel free to open an issue. For enquiries about DFx, visit Contact Us.