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.1.tar.gz
(580.5 kB
view hashes)
Built Distribution
Close
Hashes for streamlit-sortables-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1ff41562017447437a65967f429476675151e1c003f686d285676f936598d1b |
|
MD5 | 213701e1df167ce82ddefbacb0aeea15 |
|
BLAKE2b-256 | 89adb8a5b6cac496136e1c2b8978d42091645e681b7fdb280793f931690f4bc2 |
Close
Hashes for streamlit_sortables-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1bcca3483f657fe3074ca24c97436d2f4bd7cc005a8eb7155e79b721867b07f3 |
|
MD5 | 8609aff83166dcc3d7419f221257c516 |
|
BLAKE2b-256 | 21e9a741298563bb592d2a4a7aed3a7d5777fac480adc305ce3d74d3451f6516 |