Creating a multi-select drop-down list?

Hello all, I hope today is a good day for everyone.

I would like to create a multi-select drop-down list. As an example, please see this random example I found in the web:

Is this possible in Streamlit?

Basically I want to:
a) Load up a list of water quality sites (that may be different every month).
b) Load these into a multi-select drop-down menu.
c) Allow the user to select one or multiple swimming sites.
d) Based on user selection, display the data from the swimming site.

Is this possible now or in the future with Streamlit?

I’d also suggest an alternative that it seems may work in the future selecting inputs from either a dataframe of the sites, or from the points on a map, à la:

I really appreciate any thoughts or input you have.

Streamlit is like a drug to me, it is all I can think about this past week, how to use it to improve my communication of my water quality data analysis! Thank you for such a useful and wonderful tool!

What about streamlit.multiselect() ?

1 Like

Thank you for the response.
Agreed that I could use multiselect.

I just think that the check-boxes would be quite a bit easier and quicker to click multiple items (for example, I plan on having quite a number of swimming sites in the list). I am also a fan on the simple layout of the check-boxes.

But for sure, if it is not possible then I could try multiselect.

Please do check out streamlit-tags too:

1 Like

It is possible - but currently not (yet) with the available standard streamlit components.
You could write of course your own custom streamlit component that supports multi-select-drop-down lists.

That’s pretty cool! Thanks.

It’s not something I would use for this project (the site names are very specific and will be used to reference the water quality data in the data frame). But for sure I can see myself using this for some public outreach survey work we sometimes do.

Thanks :slight_smile:

Thanks again for the quick response.

Ah right, I see that streamlit can be quite flexible with the user-defined components.
I will have to read up about how these work (I am generally not a programmer, but am OK at scripting for data analysis).

Related to this, the multiselect option refreshes the page for every selection. Is it possible with a custom component to only update after finishing selection for a drop down box?

Apologies, I will be slow to reply now, it is almost midnight here and I need to sleep!