Centre radio buttons


Hey there I’m trying to center these radio buttons but not sure on how to do it.

Steps to reproduce

Code snippet:

time = st.radio(label = ' ', options = ('1 Week', '1 Month', '3 Months', '6 Months', '1 Year', '3 Years', '5 Years'), horizontal = True)

Do you mean centering the st.radio options in the page?

If so, those can be centered using a CSS selector:

import streamlit as st

    .stRadio [role=radiogroup]{
        align-items: center;
        justify-content: center;

options = ["An option", "🦈", "Another option", "🎨", "x²"]

"# 🎯 Center align elements"
st.radio("Select an option", options=options, horizontal=True)


Thanks, thats exactly what I was after!