Skip to main content

A Streamlit custom component for selecting and reordering multiple string values.

Project description

streamlit-sortable-multiselect

A Streamlit custom component for searching, selecting, and reordering multiple string values.

Install

python -m pip install streamlit-sortable-multiselect

For local development:

python -m pip install -e ".[dev]"

For frontend development:

cd streamlit_sortable_multiselect/frontend
npm install
npm run dev

Usage

import streamlit as st
from streamlit_sortable_multiselect import sortable_multiselect

selected = sortable_multiselect(
    "Favorite frameworks",
    options=[
        {"label": "Streamlit", "value": "streamlit", "icon_url": "https://streamlit.io/images/brand/streamlit-mark-color.png"},
        {"label": "FastAPI", "value": "fastapi", "icon_url": "https://fastapi.tiangolo.com/img/favicon.png"},
        {"label": "Django", "value": "django"},
        {"label": "Flask", "value": "flask"},
    ],
    default=["streamlit"],
    placeholder="Search frameworks...",
    show_move_buttons=True,
    show_numbers=True,
    base_color="#eef2ff",
    order_colors={1: "#fee2e2", 2: "#dcfce7"},
)

st.write(selected)

Build the frontend before packaging or using release mode:

cd streamlit_sortable_multiselect/frontend
npm run build

Run the example app:

streamlit run examples/basic.py

Release

Build and check the distribution files:

cd streamlit_sortable_multiselect/frontend
npm install
npm run build
cd ../..
python -m pip install -e ".[dev]"
python -m build
python -m twine check dist/*

Upload to PyPI with an API token:

python -m twine upload dist/*

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_sortable_multiselect-0.5.0.tar.gz (114.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streamlit_sortable_multiselect-0.5.0-py3-none-any.whl (113.7 kB view details)

Uploaded Python 3

File details

Details for the file streamlit_sortable_multiselect-0.5.0.tar.gz.

File metadata

File hashes

Hashes for streamlit_sortable_multiselect-0.5.0.tar.gz
Algorithm Hash digest
SHA256 92e17582b15d7d321b273192a4511d6db1d10e563ea776014f0c057e7027e537
MD5 c2046b9a681f39a401fb3bd340ca85b8
BLAKE2b-256 8c09ba4a1d67216b9025e9bb1d465b36f06173120a326e405fab306c3dc9ed24

See more details on using hashes here.

File details

Details for the file streamlit_sortable_multiselect-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_sortable_multiselect-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73a0588425742869dbed703f60bd47565599d716c5fb287f4c8a4d8a4c8b5109
MD5 b7d304f8fdc3f5ce4b3002879fa84173
BLAKE2b-256 e8da4ba5cf5d24bbf2f53a1d5404f0f6591cee191f78dbce33f2a6140b63c6c8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page