Set widemode by default

Thank the team for making this awesome tool.

I know that we can set this mode in setting. Is there any way to set the widemode by default?

Thank you

5 Likes

Hi @Tiep_Vu_Huu.

There is no way to turn wide mode on by default today, but we have an open feature request here: https://github.com/streamlit/streamlit/issues/314 (And we’re looking for contributors :wink: )

1 Like

I know this discussion is old, but I ended up here yesterday searching for the same thing, so I guess it’s worth to answer. Right now, on the version 0.77.0, it’s possible to set the wide mode by default with the streamlit.set_page_config method.

3 Likes

I have set the st.set_page_config(layout=β€˜wide’), but the page goes back centered after refreshing the page, anyone has a way to solve it?

2 Likes

I also had the issue where wide page layout was resetting to standard / non-wide mode on reload.

The fix in my case was moving page config initialisation from module scope into a function - i.e. from

import streamlit as st
st.set_page_config(layout="wide")
...

to

import streamlit as st

def do_stuff_on_page_load(...):
    st.set_page_config(layout="wide")
    ...

The former worked fine up until Streamlit 1.2 or thereabouts.

2 Likes