The beta_expander looks fantastic in the sidebar. One strange thing is that if widgets inside the expander block have st.sidebar.<widget_type>, it shows them outside the expander. If the widgets have st.<widget_type> it will show them within the expander on the sidebar.
THE RADIO BELOW WILL APPEAR ON THE SIDEBAR INSIDE THE EXPANDER:
with st.sidebar.beta_expander(‘Preferences’):
st.radio(“Select language”, [“English”, “Hindi”])
THE RADIO BELOW WILL APPEAR ON THE SIDEBAR OUTSIDE THE EXPANDER:
with st.sidebar.beta_expander(‘Preferences’):
st.sidebar.radio(“Select language”, [“English”, “Hindi”])