streamlit-pydantic
streamlit-pydantic copied to clipboard
Add a new type of radio for single input. Closes #20
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.
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'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 introducingst_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.