Detecting if using mobile browser

Can we determine if a user is viewing the page through a mobile browser?

I’m using the sidebar to filter data displayed in a graph. If a user is on a desktop browser, I’d like to show the full data set in the graph. If the user is on a smaller screen, like a mobile browser, I’d like to show a subset of that data in a graph.

Hi @acedanger,

Welcome to the community, i don’t think streamlit natively supports this, but it should be possible if we are able to delegate the media queries from react side to python.

Maybe the devs can opine on this better, you should definitely log this as a github issue.


I’ll open an issue there. Thanks.

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