"All" / "Non" For Select Widget

Is it possible to have an “All” option in the select widget. E.g. if I select “all” it does not filter the data, if I select a value it filters on that value.

Thanks

Hi @nicklatocha,

This is not currently possible with the Selectbox. Perhaps you could handle this in your application code?

import streamlit as st

options = ("all", "male", "female")
value = st.selectbox("selectbox 1", options, 1)

if value == "all":
    value = options

st.write("value 1:", value)

Let me know if something like this works for you.

2 Likes

Perfect! Didn’t think about that!

Nick