Before you add any interactivity to a Streamlit app, you need to know how to display content — text, data, media, and status messages. Streamlit provides a dedicated function for almost every type of output you’d want to present, and they all follow the same pattern: call a st. function with your content as the argument. This page covers every major content-display function you’ll need, from simple paragraphs to styled DataFrames to error banners.
Text and Markdown
st.write() is Streamlit’s Swiss Army knife — it accepts strings, numbers, Pandas DataFrames, Matplotlib figures, and many other types and renders them appropriately.
For richer formatting, use st.markdown() with standard Markdown syntax:
Headers and Structure
Use heading functions to organize your app into clear sections:
Tables and DataFrames
Streamlit offers two ways to display tabular data:
Use st.dataframe() for large datasets where users need to sort or search. Use st.table() for small, fixed reference tables where you want a clean, print-like appearance.
Images
Display local files or images from a URL:
Code and JSON
Show syntax-highlighted code samples or raw JSON data directly in your app:
Status and Alert Messages
Use status helpers to communicate state, results, and warnings to your users:
You can also display a progress bar or spinner for long-running operations:
Combining Elements
In practice you’ll combine these building blocks to create structured, readable app sections. Here’s a minimal product card: