Checklist
Summary
Provide a standalone st.avatar element to show a visual representation of users or things. This should support images (anything supported by `st.image), emojis, material icons, or short text and display it on a background.
Why?
This is a common UI component in many UI frameworks. The recent introduction of flex container makes it feasible to integrate this into many Streamlit apps.
How?
st.avatar(image: image-like, shape: "circle" | "square" | None, size: "small" | "medium" | "large")
Renders the avatar image with an appropriate background (similar to st.chat_message(avatar)). image should support anything supported by `st.image, emojis, material icons, or short text (e.g. initials).
This could be extended with on_click support and the ability to define the background color.
Additional Context
Checklist
Summary
Provide a standalone
st.avatarelement to show a visual representation of users or things. This should support images (anything supported by `st.image), emojis, material icons, or short text and display it on a background.Why?
This is a common UI component in many UI frameworks. The recent introduction of flex container makes it feasible to integrate this into many Streamlit apps.
How?
Renders the avatar image with an appropriate background (similar to
st.chat_message(avatar)).imageshould support anything supported by `st.image, emojis, material icons, or short text (e.g. initials).This could be extended with
on_clicksupport and the ability to define the background color.Additional Context