How to create 2 widgets , eg. st.text() + st.checkbox() in same line

I want to put 2 widgets in same line.
here is my code

st.subheader('Unique Item Types :')
if (st.checkbox("bar chart", key='chk_Unique_item')):
    st.bar_chart(list_of_item_type(df))
else :
    st.dataframe(list_of_item_type(df))

Current output looks like :

Expected output which I want a small checkbox by the side of a subheader.
image

Let me know is it possible and how ?

Thanks in advance.

-Irfan

This is now possible in the latest Streamlit release, with the st.beta_columns feature!

left, right = st.beta_columns(2)
with left: 
    st.subheader('Unique Item Types :')
with right:
    if (st.checkbox("bar chart", key='chk_Unique_item')):
        st.bar_chart(list_of_item_type(df))
    else:
        st.dataframe(list_of_item_type(df))
2 Likes

Thanks for quick reply,

The steamlit that i have is β€œStreamlit v0.61.0”

st.beta_columns() is introduced in which version ?

-Irfan

It’s introduced in the very latest version, 0.68!