st.header() in Streamlit
The st.header() function is a text display function in Streamlit used to show a medium-sized bold heading in your app.
It is smaller than st.title() but larger than st.subheader(). It is typically used to divide sections of your app or provide a descriptive heading for a content block.
Syntax
st.header(body)
The function has the following parameter:
- body: The text to display as a header. It can be a string, Markdown-supported text, or an f-string.
Note: st.header() automatically applies a larger font style and bold formatting for emphasis.
Example: Basic Header.
Python
import streamlit as st
month = "October"
st.header(f"Sales Report for {month}")
st.header("**Monthly** Sales Report") The output of the above code is shown below:
