liveBook · Manning

St.header

As explained in Build Python Web Apps with Streamlit

st.header is a Streamlit display API element that renders text as a section heading smaller than a title.

st.header renders a section heading in Streamlit. It resembles st.title but uses slightly smaller text, making it useful for labeling a part of an app such as a task list. section 4.2.1

Label a task list

Use st.header with a string and optionally add a divider beneath it: st.header("Today's to-dos:", divider="gray"). Save the Python file and run it with streamlit run todo_list.py to view the heading in the app. section 4.2.1

Configure the divider to fit the page structure:

  • Pass a specific color such as "gray" to display a line beneath the heading. section 4.2.1
  • Set divider=True when the app has multiple headers and you want Streamlit to cycle between divider colors. section 4.2.1

How Build Python Web Apps with Streamlit covers it

How deep it goes
Explains the heading size, divider argument, colors, and execution command, but stops short of deeper rendering internals.
Examples
Demonstrates a Today's to-dos heading with a gray divider in a progressively built task-list app.
What it assumes
Assumes basic Python file editing and Streamlit app execution while introducing the heading element from a simple task-list requirement.
What you can do after
Apply it via Streamlit to add readable section headings and optional visual dividers to an app.
How it connects
Connects st.header with st.title, Streamlit execution, and task-list widgets such as st.checkbox.

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.