I have some sliders with values initialised. Later, I have functions that change the value coming from the slider. Is there a way for the slider value and visual position to be updated with this new value?
In it’s most basic form, I’ve tried
import streamlit as st
def slider(value=3):
slider_value = st.slider("my nice slider", min_value=0, max_value=10, value=value)
return slider_value
slider_value = slider()
st.write(f"Slider value is {slider_value}")
if st.button("Increment slider by 1"):
slider_value = slider_value + 1
slider_value = st.slider("my nice slider", min_value=0, max_value=10, value=slider_value)
st.write(f"Slider value is {slider_value}")
but that just duplicates the slider, when I want it to update the original one.
Any help or ideas on this? Thanks!