How do we define what is rendered on the browser ?
Here’s a summary of where we are right now.
declare_component—pings the component webserver for its
index.html with the
CustomSlider component code.
_component_func are transferred to
CustomSlider. This is specific to the React template and encoded within
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.
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.