arnaudmiribel / streamlit-extras

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

🐛 [BUG] - bottom() doesn't respect sidebar #232

Closed Ginner closed 2 months ago

Ginner commented 3 months ago

Description

I'd like to add text to the bottom of the sidebar. However, putting a bottom container in the sidebar, moves the container to the bottom of the content window.

Reproduction steps

  1. Create the following app:
    
    import streamlit as st
    from streamlit_extras.bottom_container import bottom

st.write("Hello World")

with st.sidebar: st.write("This is a sidebar") with bottom(): st.write("This should be in the bottom of the sidebar.")


2. run the app

### Version of streamlit

1.36.0

### Version of streamlit-extras

0.4.3
arnaudmiribel commented 2 months ago

Ah, good point, I can reproduce this. Will let @LukasMasuch respond if that was meant to work - if not, worth stressing that it doesn't work in the docs.

lukasmasuch commented 2 months ago

@Ginner The bottom contains always refers to a root container at the bottom of the main content area. This is similar to st.sidebar. So, it doesn't really matter where you call it.

Ginner commented 2 months ago

Okay, so to understand correctly, it is the intended behavior? If so, I'd agree with arnaudmiribel in specifying it in the docs.

I'd find the functionality of being able to use it in the sidebar useful.