with st.sidebar():
with st.container():
for 1 in rang(100):
st.text_input()
st.button()
How to apply css, so that container has a scrollbar, and it takes all the available vertical space, sidebar itself does not scroll, and also button is always kept visible?
That’s a good point, it’d be nice if the height parameter of a container could be set in viewport units. The alternative is to set a key to the container and use that to target the container with CSS:
app.py
import streamlit as st
st.html("style.css")
with st.sidebar:
with st.container(key="sidebar-cont"):
for i in range(100):
st.text_input(f"Input {i}")
st.button("Click me")