Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README.md fix #14

Open
WillC3 opened this issue Mar 14, 2024 · 0 comments
Open

README.md fix #14

WillC3 opened this issue Mar 14, 2024 · 0 comments

Comments

@WillC3
Copy link

WillC3 commented Mar 14, 2024

There are various typos in your README. Here's the fixed file:

Streamlit Sortables

A Streamlit component to provide sortable list.
You can sort the list of strings on the UI as follows.

streamlit-sortables.mp4

Installation

$ pip install streamlit-sortables

Usage

Call sorted_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 multi_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, multi_containers=True)

st.write(f'original_items: {original_items}')
st.write(f'sorted_items: {sorted_items}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant