Configures the default settings of the page.


This must be the first Streamlit command used in your app, and must only be set once.

Function signature

st.set_page_config(page_title=None, page_icon=None, layout="centered", initial_sidebar_state="auto")


page_title (str or None)

The page title, shown in the browser tab. If None, defaults to the filename of the script ("" would show "app • Streamlit").

page_icon (Anything supported by st.image or str or None)

The page favicon. Besides the types supported by st.image (like URLs or numpy arrays), you can pass in an emoji as a string ("🦈") or a shortcode (":shark:"). If you're feeling lucky, try "random" for a random emoji! Emoji icons are courtesy of Twemoji and loaded from MaxCDN.

layout ("centered" or "wide")

How the page content should be laid out. Defaults to "centered", which constrains the elements into a centered column of fixed width; "wide" uses the entire screen.

initial_sidebar_state ("auto" or "expanded" or "collapsed")

How the sidebar should start out. Defaults to "auto", which hides the sidebar on mobile-sized devices, and shows it otherwise. "expanded" shows the sidebar initially; "collapsed" hides it.

Was this page helpful?

editSuggest edits

Still have questions?

Our forums are full of helpful information and Streamlit experts.