pythonstreamlit

'selection_mode' not working in streamlit pills


I want to use streamlit pills to get the multiselect function

I tried using st.pills() and followed streamlit-pills

options = ["North", "East", "South", "West"]
selection = st.pills("Directions", options, selection_mode="multi")
st.markdown(f"Your selected options: {selection}.")

AttributeError: module ‘streamlit’ has no attribute ‘pills’

Then to get about this I followed: streamlit-pills pypi and then I did pip install streamlit-pills

from streamlit_pills import pills
selected = pills("Label", ["Option 1", "Option 2", "Option 3"], ["🍀", "🎈", "🌈"])
st.write(selected)

In this mode streamlit pills work, but the selection_mode="multi" does not work in this option.

I even tried pip install streamlit-pills-multiselect, following streamlit-pills pypi multiselect but still no luck.


Solution

  • Please ensure you are using the Streamlit version 1.40.0.

    st.pills() method does not exist in versions 1.39.0 and lower.