I have a long list of options for my Radio widget and it doesn’t look/feel nice when you have to scroll. I want to limit it’s behavior of expanding vertically.
Steps to reproduce
Create a long Python list
Pass this list as the options parameter of the Radio widget
Expected behavior:
Scrollable list of selectable radio items.
Actual behavior:
Very long list that expands vertically.
Additional information
I thought of placing the Radio widget inside a container. Would it work?
I do not want to use the horizontal option of the Radio widget.
Since I have a list of timestamps that I want to be seen at all times, using a selectbox isn’t the optimal solution - since the user would have to click each time to display the elements.
If I place the radio widget inside a container, that has a height parameter, wouldn’t it be forced to be contained within this container? My expected outcome would be as follow: Radio elements are expanded and visible, but the user would need to scroll within the container.
st.container does not have a height parameter. In case you manage to specify the height with css/js, you may also need to take care of the scrollbar (not sure about this - haven’t tried it)
A simple method would be to combine your timestamps into different groups, and then display these radio button groups for the user to choose from. It would become more manageable then.
@ferdy One follow up question - this change applies a height setting to other widgets (checkbox, dropdown etc.). Is there a way to apply it only to the radio widget?
Update - nevermind found it just changed it to .row-widget.stRadio
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.