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. See the body parameter of st.markdown for additional, supported Markdown directives. |
unsafe_allow_html (bool) | Whether to render HTML within body. If this is False (default), any HTML tags found in body will be escaped and therefore treated as raw text. If this is True, any HTML expressions within body will be rendered. Adding custom HTML to your app impacts safety, styling, and maintainability. Note If you only want to insert HTML or CSS without Markdown text, we recommend using st.html instead. |
help (str or None) | A tooltip that gets displayed next to the caption. If this is None (default), no tooltip is displayed. The tooltip can optionally contain GitHub-flavored Markdown, including the Markdown directives described in the body parameter of st.markdown. |
Examples

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