How do we define what is rendered on the browser ?
Here’s a summary of where we are right now.
_component_func
—returned by declare_component
—pings the component webserver for its index.html
with the CustomSlider
component code._component_func
are transferred to props.args
for CustomSlider
. This is specific to the React template and encoded within withStreamlitConnection
. If you’re using another JS framework or vanilla Javascript, you will need to retrieve the arguments from within the JS event.props
to the Slider
component from baseui
, which acts as a stateless view of our component. Anything in the return statement of CustomSlider
is rendered on the web browser.CustomSlider
key
argument prevents the slider from being remounted when props are changed or the script is rerun.So we now have an interactive CustomSlider
. The third part of the tutorial will dig into returning the state of the slider back into the Streamlit app.