I want to provide suggestions / autocomplete based on a list of values in text_input in streamlit
text_input(label = "select location", max_chars=200, placeholder="
<enter_country_name>", autocomplete = [some list of value])
However, I get that the error can be only accepted b or string then how can we suggest something as below
e.g. if write Del -> Delhi similarly, if write Kol -> Kolkata
Refer to this custom made tool that enables autocomplete from searches, not select boxes: https://github.com/m-wrzr/streamlit-searchbox
You can't achieve this with st.text_input
. Right now the only way is using st.selectbox
ou st.multiselect
.
Using st.selectbox
you'll have to pass a sequence of options. The user will be able to select one of them OR type a keyword in the selectbox. Along the typing all the options that matches what user is typing will be shown.
Same goes for st.multiselect
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With