arnaudmiribel / streamlit-extras

Discover, try, install and share Streamlit re-usable bits we call "extras"!
https://extras.streamlit.app
Apache License 2.0
727 stars 124 forks source link

🐛 [BUG] - Row Layout does not work in a container #235

Closed nixilb closed 1 month ago

nixilb commented 2 months ago

Description

Need to nest row into st.container

Reproduction steps

VectorStoreListContainer = st.container(border=True)

no way to add

row2 = row([2, 4, 1], vertical_align="bottom")

row2.button("Send", use_container_width=True)
row2.button("Send2", use_container_width=True)
row2.button("Send3", use_container_width=True)

into this container

Version of streamlit

1.36

Version of streamlit-extras

0.4.3

arnaudmiribel commented 1 month ago

Hey @nixilb, using a with: statement works for me. Have you tried the following?

image

Code:

import streamlit as st
import streamlit_extras
from streamlit_extras.row import row

VectorStoreListContainer = st.container(border=True)

with VectorStoreListContainer:
    row2 = row([2, 4, 1], vertical_align="bottom")
    row2.button("Send", use_container_width=True)
    row2.button("Send2", use_container_width=True)
    row2.button("Send3", use_container_width=True)
nixilb commented 1 month ago

Ho! merci+++ I'll try!