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.2.tar.gz
(580.6 kB
view hashes)
Built Distribution
Close
Hashes for streamlit-sortables-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f725dcf2710fe9bb10fa0036821cb1ac4989915d52117b6963c3a74d21226c4 |
|
MD5 | 5d0254fa41bddbaee2295bea05af024d |
|
BLAKE2b-256 | f7eae26f0184c27580680e2ee1588e72012353b384513f3d3729e5e6e3a8a563 |
Close
Hashes for streamlit_sortables-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c1f95b3bd0ae35d648d7a875b7b41baa52a029a877a34b4937746f473bba801 |
|
MD5 | 68746d34621b30346ef120c5caab9513 |
|
BLAKE2b-256 | db8b7ea75ea0c2705e3fc762b70f70e152cffc686531a6bdf2da8a9af451c32f |