blackary / st_pages

An experimental version of Streamlit Multi-Page Apps
MIT License
456 stars 76 forks source link

st.set_page_config settings are not respected in other pages #98

Open bjo opened 4 months ago

bjo commented 4 months ago

I have an application that sets the fields layout, page_icon and page_title in st.set_page_config(). However, when I navigate to other pages set up through show_pages(), these settings are ignored (i.e. layout is not 'wide' in those pages)

James-Rocker commented 3 months ago

This is due to the function add_page_title. My workaround is to import that function and then send you page config kwargs to that.

e.g.

add_page_title(
        add_icon=True,
        also_indent=True,
        hidden_pages=None,
        page_icon="https://53.fs1.hubspotusercontent-na1.net/hub/53/hubfs/image8-2.jpg?width=595&height=400&name=image8-2.jpg",
        layout="wide",
    )

Although the downside is it forces you to have a page title which you might not want