Using CSS and deleting/reordering some HTML in my browser’s developer tools, I hacked this from a select_slider:
st.select_slider("Displayed values:", ["Normalized", "Absolute"])
Would be cool to have something built-in that looks similar to this (regarding the display of labels, not the design):
What do you think?
Edit: I found this related topic, but it also does not have the labels to the left/right of the toggle:
OK, so I’m definitely making progress.
The custom component shows up
The user can interact with it
The label is passed through to the React component successfully
However, the communication between the React Component and Python component is not yet fully working:
The component always returns a value of True
Passing value=False does not result in the switch defaulting to off.
I’ll take another look with fresh eyes later on (any pointers, of course, most welcome!).
1 Like
Hi @StefanBrand ,
Thank you for sharing with the Streamlit community! We are always interested in learning more about desired features. Please feel free to submit a feature request here (click “New Issue” → Feature Request).
Best,
Caroline