Layouts and Containers
Complex layouts
Streamlit provides several options for controlling different elements are laid out on the screen.
Sidebar
Display items in a sidebar.
python
st.sidebar.write("This lives in the sidebar")
st.sidebar.button("Click me!")
Columns
Insert containers laid out as side-by-side columns.
python
col1, col2 = st.columns(2)
col1.write("this is column 1")
col2.write("this is column 2")
Expander
Insert a multi-element container that can be expanded/collapsed.
python
with st.expander("Open to see more"):
  st.write("This is more content")
Container
Insert a multi-element container.
python
c = st.container()
st.write("This will show last")
c.write("This will show first")
c.write("This will show second")
Empty
Insert a single-element container.
python
c = st.empty()
st.write("This will show last")
