Horizontal radio buttons

Is it possible to create horizontal radio buttons?

1 Like

Hi @avinash and welcome to the forum! :wave:

Right now that’s not supported in Streamlit, but we are working on it (see our Roadmap for more info). Feel free to add your ideas to Customizable Layout for Streamlit.

And thanks for using Streamlit!

I found that this works:


st.write('<style>div.Widget.row-widget.stRadio > div{flex-direction:row;}</style>', unsafe_allow_html=True)

But it it going to be applied to all radiobutton of the page. It feels a bit hacky and might break at a future release of streamlit… so use with caution

3 Likes