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.3.tar.gz
(580.6 kB
view hashes)
Built Distribution
Close
Hashes for streamlit-sortables-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 882fa946aa46dc4e7fc7d48b336630908b0c82b754733c4ece851af4d1c8acc7 |
|
MD5 | 4b822e13d12f0139229d160d7440e2af |
|
BLAKE2b-256 | dbb93d69b273a4aaab060eb74691e87495ff28082af8f231e01ec2bc35fa7375 |
Close
Hashes for streamlit_sortables-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6bb37f7c5d179b2ea2907d0598659a75691377ce9fc5347ed5ad413058f48c67 |
|
MD5 | ea5525680988127460cc5e23d3af6c13 |
|
BLAKE2b-256 | 2dee60f65a82bfcc422052d6a2e4cd1a47a182385c5bd8dc23ac16de6338a0a2 |