Change font size or width of selectbox

I wonder if there is any ways to change the font size of selectbox options?
All of my options are long string and can not display whole when dropdown the selectbox.

Or increase the width of selectbox might also works.

Hey @ChiHangChen,

Welcome to the Streamlit community!!! :tada: :tada: :tada: :tada: :tada: :tada: :tada: :partying_face: :tada: :tada:

You can’t currently change the font size on the selectbox options. The width of the selectbox is the full width of the page, or column its in. Which means that you can make it wider by putting the selectbox in a wider column.

If you need to make the page layout wider to achieve this you can use the st.set_page_config(layout="wide") as the first Streamlit call to use all the available space in your app!

Happy Streamlit-ing!
Marisa

I understand, thank you

Think it would be very nice to be able to change font size of select box, sliders … etc. given there are varying amounts of content one is putting into the sidebar.

4 Likes

Couldn’t we show the string entirely when hovering over an element of the selectbox as a compromise ?

This solution works for me: