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
