[X] I have searched the existing issues for similar feature requests.
[X] I added a descriptive title and summary to this issue.
Summary
Hi all,
The segmented_control component is a fantastic new component that I think will be used a lot by Streamlit users.
However, I currently miss 1 option, that is to require a value. For example, now it is possible to provide a default value which can be unclicked.
Why?
In many use cases where segmented_control will be used in a single mode, the developer might want to force the user to select something.
How?
I propose to expand the segmented_control (and pills) API by adding an extra parameter 'required' . If required is True, a value must always be selected.
Checklist
Summary
Hi all,
The
segmented_control
component is a fantastic new component that I think will be used a lot by Streamlit users.However, I currently miss 1 option, that is to require a value. For example, now it is possible to provide a default value which can be unclicked.
Why?
In many use cases where segmented_control will be used in a single mode, the developer might want to force the user to select something.
How?
I propose to expand the
segmented_control
(andpills
) API by adding an extra parameter 'required' . Ifrequired
is True, a value must always be selected.