streamlit-avatar is a Streamlit component designed to easily display avatar icons within Streamlit applications. It supports showing avatars from image URLs or displaying text/initials. The current version is 0.1.3, and it generally follows the Streamlit component release cycle, with updates as needed for compatibility or new features.
pip install streamlit-avatarVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to display both an image-based avatar from a URL and a text-based avatar (e.g., initials) using the `streamlit_avatar` component. It showcases setting size, border styles, and click actions.
For text avatars (e.g., initials), set `is_image=False` and pass the desired text (e.g., 'JD') directly to the `url` parameter, rather than a URL that generates an image from text.
Always use `streamlit run <your_script_name>.py` from your terminal to execute Streamlit applications that use this component.
Utilize the provided parameters for styling. For highly custom styles, explore Streamlit's `st.markdown(unsafe_allow_html=True)` with caution to target specific HTML elements rendered by the component, or consider contributing to the component's styling options.