How to resize the avatar icon in the chat_message function?

image

I want to adjust the size of the icon that appears through this chat_message function.
According to the avatar parameter information in this document, there is no explicit information about size adjustment, but since we receive url and array format, I think it can be done without css using PIL and st.image.

Is it possible to adjust the avatar icon size without css?

Hey @jhyuk , we set the avatar image to a constant value of 2rem here
streamlit/frontend/lib/src/components/elements/ChatMessage/styled-components.ts at develop · streamlit/streamlit · GitHub, so I don’t think you are able to modify the size with the image arguments. You could try to apply custom CSS via st.html though if you really want to change the size.

That was very helpful, thank you, I changed the size using CSS.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.