My main motivation was to be able to use FontAweseome Icons in Button Labels. Furthermore, it was important to me that I can align the buttons easily left, right, center.
Primarily, I use these buttons as download buttons. In this mode, they do not return a value and the page does not refresh. The return of a value can be controlled by the return_value parameter.
Some examples:
Button with FontAwesome Icon:
ButtonGroup with 3 Buttons:
Custom CSS Styling:
Example 1:
Example 2:
One thing to note:
The buttons offer three distinct modes, which can be configured through the mode parameter.
Default: Acts like a normal button, but unlike Streamlit Buttons, these buttons maintain their value after script re-execution.
Radio: Functions as a radio button, where only one button remains active at any given time.
Checkbox: Works like a checkbox, enabling the toggling of multiple buttons concurrently.
Hey @Tian,
I have started using your component and I want to ask you if it is possible to return the ‘value’ from the buttons dictionary instead of the index/position of the button that is being clicked on.
I am having trouble downloading the updated version.
ERROR: st-btn-group has an invalid wheel, st-btn-group has an invalid wheel, multiple .dist-info directories found: st_btn_group-0.0.10.dist-info, st_btn_group-0.0.9.dist-info
Is this something on my end or maybe an issue when uploading to pypi?
@Tian Hey, thanks a lot for this contribution!
I am using this in a chat bot (st.chat_input, st.chat_message) to show a like/dislike option after each response. The issue is, as soon as it reaches the code block for st_btn_group, the app reruns multiple times, that makes it very glitchy. Is there any possible solution for this?