liveBook · Manning

St.set_page_config

As explained in Build Python Web Apps with Streamlit

st.set_page_config is a Streamlit API function that sets page-level configuration such as layout and page metadata.

Use st.set_page_config to make a dense Streamlit dashboard use available screen space instead of leaving the content centered with wide blank margins. section 6.3.1

Place the call immediately after the imports and before every other Streamlit command. The wide layout is especially useful when a dashboard displays several filter controls across the page. section 6.3.1

Expand a dashboard to a wide layout

import streamlit as st from data_wrangling import prep_data st.set_page_config(layout="wide") data = prep_data() filter_panel(data) section 6.3.1

Keep these implementation points in mind:

  • Call st.set_page_config only as the first Streamlit command executed by the app. section 6.3.1
  • Use layout="wide" when horizontally dense content needs more room than the default centered layout provides. section 6.3.1
  • A wide layout complements a filter panel with several columns and produces a more usable dashboard presentation. section 6.3.1

How Build Python Web Apps with Streamlit covers it

How deep it goes
Explains the layout option and first-command constraint, but does not detail other configuration parameters.
Examples
Uses a wide filter panel and a minimal dashboard script to show the resulting space improvement.
What it assumes
Assumes basic Python imports and Streamlit app structure, while teaching the command-ordering requirement explicitly.
What you can do after
Apply it via Streamlit to configure a dashboard for horizontally dense content.
How it connects
Connects page layout with Streamlit columns, expanders, multiselect controls, and dashboard design.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build Python Web Apps with Streamlit. The section links point to the parts of the book it draws on.