Hi I would like to adjust streamlit container to have a default size and the ability to scroll using CSS as I have found no way to achieve without using those. Is there a guide on how to start the implementation.
For more information, I want to fit a default height container with variable wall of text such that if the text is long the user will have the option to scroll on that specific container instead of the whole webpage.
Hope you’ve been well. Just wanted to update you this is now natively supported in Streamlit as of Release 1.30.0! You can set a fixed height to st.container allowing grids and scrolling containers.
Check it out in the docs! Looking forward to hearing what you think.
I need to know if we can use smooth or auto scrolling. Currently I’m trying to pass message inside the st.container, but the latest message is not immediately visible; users need to scroll down to see it.
I may be misunderstanding what you mean by auto scrolling, and “smooth” seems unrelated to “users need to scroll down” so I am not really sure what you are after.
as you can see messages are passed in container, where latest message are not immediately visible need to scroll down to see it. Does st.container can handle auto scrolling
I had the same issue with a chatbot app I created. I just added empty lines at the end of the main container so that the chatbot messages appear before the chatbot input like this:
# Adds empty lines to the main app area to avoid hiding text behind chat buttons
# (might need adjustments)
st.write("")
st.write("")
st.write("")
st.write("")
st.write("")
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.