Different text sizes for labels of widgets


Is it possible to set labels of a widget (e.g. radio buttons) to have texts of varying size? I want to have a multi-level radio selection, if possible at all.

Welcome to the community, @aghasemi!

If I understand you correctly, that’s not possible right now (but a great feature request!) But let me check that I understand. What you want is for the labels on the radio buttons to have different text sizes - so as an example, in the below code, you would want ‘Comedy’ to be a larger text size than ‘Drama.’

genre = st.radio(
   'Pick a movie genre',
   ('Comedy', 'Drama', 'Documentary')

If so, this would be an excellent candidate for a custom, user-defined widget, which is a feature being tracked here. Please feel free to follow that feature request and / or comment with your use-case.

Thank you for using Streamlit!

Yes exactly this. More precisely, I want to create a multi-level radio button, and even more precise than that, I will use it to have a slide show in my demo, combining presentation and demonstration.

Many thanks

Great - I just added that to the feature request.

There might be a way to do what you want with another widget. Can you tell me more about exactly how you want the slideshow to work?

Just a typical table of content where each item yields to a page/slide (with bullets, …)
Sorry for the late reply.

1 Like

Thanks for the additional info @aghasemi. Just added it to the associated GitHub issue!