How to use a streamlit site on the smartphone?

Is it possible to adapt a site made in streamlit to mobile form? I generated my website, but when I open it on a smartphone, the graphics are super applied and I can’t reduce the size.

Hi @isa.rsn -

The unfortunate answer is yes and no. Streamlit does detect the screen size and will provide a responsive layout. But some libraries such as matplotlib often have pixel sizes hard-coded in, so you might have a 500px x 300px image and its size will be fixed.

So depending on what those graphics are, you’ll need to handle that yourself. If they do happen to be matplotlib graphics, a nice solution is to use Altair/Bokeh/plotly, as they are web-first visualization frameworks and tend to handle those types of issues nicely.


Thanks for the answer. I thought about adjusting the plot size according to the page size. For example, instead of using the height=800 argument, use another one that asks for the percentage of the page that will be occupied by the plot. Do you know if there is any argument that does this?