A Streamlit component to provide sortable list.
Project description
Streamlit Sortables
A Streamlit component to provide sortable list. You can sort the list of strings on the UI as follows.
It also supports moving items between multiple containers.
Instllation
$ pip install streamlit-sortables
Usage
Call soretd_items
method with a list of string. Return value is the sorted items.
import streamlit as st
from streamlit_sortables import sort_items
original_items = ['A', 'B', 'C']
sorted_items = sort_items(original_items)
st.write(f'original_items: {original_items}')
st.write(f'sorted_items: {sorted_items}')
You can pass list of dicts with multiple_containers=True
.
import streamlit as st
from streamlit_sortables import sort_items
original_items = [
{'header': 'first container', 'items': ['A', 'B', 'C']},
{'header': 'second container', 'items': ['D', 'E', 'F']}
]
sorted_items = sort_items(original_items, multiple_contaieners=True)
st.write(f'original_items: {original_items}')
st.write(f'sorted_items: {sorted_items}')
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-sortables-0.1.0.tar.gz
(369.9 kB
view hashes)
Built Distribution
Close
Hashes for streamlit-sortables-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbeb6b6c25387bcd2e25d1d59b67aefada2a58ecc12e938f5a5a630bf4ad8a80 |
|
MD5 | 607e5cbd0266e88a1b00b6c7f997aa66 |
|
BLAKE2b-256 | cd8b48ab71d1f3d5218eb205a5f87eac57caff3fb93bf98ef23ebcfbeb182670 |
Close
Hashes for streamlit_sortables-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a500f26a23160bdad1df119d540c18a19131301aebe6513ee84025c9e0e2ef86 |
|
MD5 | 34c5c484c8fd044c38c2107662cbac1b |
|
BLAKE2b-256 | ab2e867531bf06560b2c154a209902534b732e373d56defdfdb78ac0ae99a46f |