Display warning message.
Function signature

st.warning(body, *, icon=None)


icon (None)

An optional parameter, that adds an emoji to the alert. The default is None. This argument can only be supplied by keyword.

body (str)

The warning text to display.


st.warning('This is a warning', icon="⚠️")

Was this page helpful?

editSuggest edits

Still have questions?

Our forums are full of helpful information and Streamlit experts.