Using CSS to create scrollable streamlit container

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.

Hi, thanks for posting your issue. We love hearing from the community!

I think for this, you might want to use the html component: Components API - Streamlit Docs

You might have to write some hacky html but after that, i think you might be able to pass scroll=True.

Let me know if this helps.

It does helps, thanks for the reply

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.


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. :blush: