Hi everyone!
I want to display a slider with the following options: [1000, 2000, 5000, 10000, 50000, 100000], and have 10000 as the initial default value. Here is the expected result:
Since the step varies, st.slider
won’t work here, so I chose st.select_slider
, which treats each option as a category:
iterations = st.select_slider(
label="Iterations",
options=[1000, 2000, 5000, 10000, 20000, 50000, 100000],
)
There is a value
argument in the st.select_slider
widget to set the default value. If none is provided, the initial default is the first element from the options list. This is not the behavior I want for my use case. However, I can’t set value=10000
either, because it only accepts iterables, in order to create a double-ended slider, which I also don’t want.
Is there a way to create a widget as shown in the GIF?