streamlit-pydantic icon indicating copy to clipboard operation
streamlit-pydantic copied to clipboard

Add a new type of radio for single input. Closes #20

Open y805939188 opened this issue 2 years ago • 2 comments

What kind of change does this PR introduce?

  • [ ] Bugfix
  • [x] New Feature
  • [ ] Feature Improvement
  • [ ] Refactoring
  • [ ] Documentation
  • [ ] Other, please describe:

Description:

In my scenario, users want to be able to select by the st.radio component when making a single selection. So I solved this problem by passing a "st_kwargs_ui_type" to Field. Another way is to create a new type named "RadioContent" like "FileContent". If there are other better ways, please tell me. Thank you very much.

Checklist:

  • [x] I have read the CONTRIBUTING document.
  • [x] My changes don't require a change to the documentation, or if they do, I've added all required information.

y805939188 avatar Jan 19 '23 08:01 y805939188

I'm not the maintainer obviously but I like the idea of adding radio buttons as an option wherever a single selectbox is currently used.

Would it make more sense though to re-use the format attribute (instead of introducing st_kwargs_ui_type). It's already being used for very similar purposes for multi-line text and date/time/datetime.

HIL340 avatar Feb 06 '23 04:02 HIL340

I'm not the maintainer obviously but I like the idea of adding radio buttons as an option wherever a single selectbox is currently used.

Would it make more sense though to re-use the format attribute (instead of introducing st_kwargs_ui_type). It's already being used for very similar purposes for multi-line text and date/time/datetime.

I think you are right, maybe it's better to use format, I will try to change to format later when I have time. thank you.

y805939188 avatar Feb 07 '23 03:02 y805939188