Display a success message.

Function signature[source]

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

Parameters

body (str)

The success text to display.

icon (str, None)

An optional emoji or icon to display next to the alert. If icon is None (default), no icon is displayed. If icon is a string, the following options are valid:

  • A single-character emoji. For example, you can set icon="🚨" or icon="🔥". Emoji short codes are not supported.

  • An icon from the Material Symbols library (outlined style) in the format ":material/icon_name:" where "icon_name" is the name of the icon in snake case.

    For example, icon=":material/thumb_up:" will display the Thumb Up icon. Find additional icons in the Material Symbols font library.

Example

import streamlit as st

st.success('This is a success message!', icon="✅")
forum

Still have questions?

Our forums are full of helpful information and Streamlit experts.