-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add st.radio in st.column_config #7134
Comments
To help Streamlit prioritize this feature, react with a 👍 (thumbs up emoji) to the initial post. Your vote helps us identify which enhancements matter most to our users. |
We don't plan to add radio buttons to data editor right now since a) the use case should already be covered by
That's the standard term for this component in UI design. I actually had no idea why it's called radio though! Turns out, it's because they are named after actual radio receiver buttons:
|
Sorry. To clarify, select one row at a time and return the row index. I know this is mentioned in #688 and addressed with Selectbox column. But with Selectbox it allows multiple selections. What if we just want a single row to be selected at a time? It would be pretty time consuming for users to deselect the others manually. And to deselect, we can't set So that's why I thought the radio column is still needed. |
a long needed option to be able to select single row and get feedback on that to allow easier items selection for further processing and displaying info. Radio column where only single row can be selected might be a good way for |
🤚🏼 |
This is definitely needed - I'm working on a supply chain app and various times wished for either this, or the ability to select a table row to prompt an action. |
Defneed single select option instead of checkboxcolumn. |
+1 to the single selection feature of data-editor. It is needed for our use case too. |
Ah sorry, I completely misunderstood this feature request in the beginning! If it's about selecting a single row from a dataframe, the good news is that this will be covered by the upcoming dataframe selections feature we're working on (#8411). See my update with link to demo app here (and I'll also give further updates on that other issue since it's the more general one). |
We will release row & column selections for selection = st.dataframe(df, on_select="rerun", selection_mode="single-row") This will probably enable many use cases related to the radio column. It's unlikely that we will add a dedicated radio column to the column config in the near future. What's more likely is that we add the same selection support to |
Thank you!!! I don't know about others, but row selection is really one of the most wanted features for me. |
## Describe your changes This PR adds row and column selection support to `st.dataframe`. It can be used like this: ```python selection = st.dataframe( df, on_select="rerun", selection_mode="single-row" ) ``` - [Demo App](https://dataframe-row-selections.streamlit.app/) https://github.com/streamlit/streamlit/assets/2852129/f3ff476a-0bd0-4b82-bc97-6bda3a3be98c ## GitHub Issue Link (if applicable) - Closes #688 - Closes #7134 - #455 - #8319 ## Testing Plan - Added unit tests - Added e2e tests (see #8634) ```[tasklist] ### e2e tests - [x] Single row/column selection - [x] Multi row/column selection - [x] Mixed selections - [x] Screenshot of a dataframe with multiple selections - [x] Clear selections via toolbar - [x] Clear selections via escape - [x] Select all rows in multi-row selection via top checkbox - [x] Optional: Test drag and drop selection - [x] Optional: Test shift selections - [x] Optional: Test selections in form - [x] Have some test cases work with session state and others with return value - [x] Add a test case validating that the callback gets called ``` --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license. --------- Co-authored-by: Benjamin Räthlein <benjamin.raethlein@gmail.com>
Checklist
Summary
Similar to having
st.column_config.CheckboxColumn
, I wonder if we can have the "single-select" st.radio in the column configuration.Should not need a major rework.
Why?
Allow the option to select only one row at a time. This is helpful for us to develop a pseudo file explorer with
st.data_editor
.How?
Add e.g.
st.column_config.RadioColumn
Additional Context
st.radio manual. Why is this called "radio" btw?
The text was updated successfully, but these errors were encountered: