Display text in small font.
This should be used for captions, asides, footnotes, sidenotes, and other explanatory text.
Function signature[source] | |
---|---|
st.caption(body, unsafe_allow_html=False, *, help=None) | |
Parameters | |
body (str) | The text to display as Github-flavored Markdown. Syntax information can be found at: https://github.github.com/gfm. This also supports:
|
unsafe_allow_html (bool) | By default, any HTML tags found in strings will be escaped and therefore treated as pure text. This behavior may be turned off by setting this argument to True. That said, we strongly advise against it. It is hard to write secure HTML, so by using this argument you may be compromising your users' security. For more information, see: |
help (str) | An optional tooltip that gets displayed next to the caption. |
Examples
import streamlit as st st.caption('This is a string that explains something above.') st.caption('A caption with _italics_ :blue[colors] and emojis :sunglasses:')

Still have questions?
Our forums are full of helpful information and Streamlit experts.