Slider for Categorical Text input

How can I create a slider for taking as input categorical text data. The slider currently takes in only numbers.

I want to avoid using st.multiselect

st.selectbox gives me a drop down list

Is slider a possibility??

Hello @altamash, welcome to the community!

There’s actually a select_slider method (documentation) which should solve your problem :slight_smile:

color = st.select_slider(
     'Select a color of the rainbow',
     options=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'])
st.write('My favorite color is', color)

Hope that helps!



Thank a lot!!!