streamlit icon indicating copy to clipboard operation
streamlit copied to clipboard

Add icon to st.dialog

Open alex-bork opened this issue 1 month ago • 7 comments

Checklist

  • [x] I have searched the existing issues for similar feature requests.
  • [x] I added a descriptive title and summary to this issue.

Summary

Hi :-),

I think it would be nice to have the possibility to attach an icon to a st.dialog in the front of the dialog title ... just an idea, nothing urgent.

Best Regards

Why?

No response

How?

No response

Additional Context

No response

alex-bork avatar Dec 03 '25 13:12 alex-bork

To help Streamlit prioritize this feature, react with a 👍 (thumbs up emoji) to the initial post.

Your vote helps us identify which enhancements matter most to our users.

Views

github-actions[bot] avatar Dec 03 '25 13:12 github-actions[bot]

@alex-bork Thanks for the suggestion :) I agree that this seems like a good idea. In the meantime, as a workaround you can use markdown as part of the title, which allows you to use material icons within the title:

@st.dialog(":material/chart_data: Chart Explorer")

lukasmasuch avatar Dec 03 '25 13:12 lukasmasuch

Hi! @lukasmasuch I’d love to contribute to this feature. I was thinking to implement dialog icon support using a simple string + image approach (emoji, URL, or local image path). That’s the model I have in mind, but please let me know if you'd prefer a different direction.

KaranPradhan266 avatar Dec 06 '25 02:12 KaranPradhan266

@KaranPradhan266 I think we only want to keep this consistent with other icon parameters, which only support material icons and emojis:

Image

This is using the shared DynamicIcon.tsx component.

lukasmasuch avatar Dec 06 '25 13:12 lukasmasuch

@lukasmasuch Understood. I’ll begin working on this now.

KaranPradhan266 avatar Dec 06 '25 18:12 KaranPradhan266

@lukasmasuch @alex-bork Let me know if this looks good to you?

https://github.com/user-attachments/assets/d88ee924-9ab2-4b2b-9fdb-bdd5037bfe75

KaranPradhan266 avatar Dec 06 '25 21:12 KaranPradhan266

@lukasmasuch @alex-bork Let me know if this looks good to you?

Screen.Recording.2025-12-06.at.1.11.48.PM.mov

Yes, looks great! :-) Best Regards

alex-bork avatar Dec 08 '25 10:12 alex-bork

Closing as implemented in PR https://github.com/streamlit/streamlit/pull/13244 🎉

mayagbarnes avatar Dec 16 '25 18:12 mayagbarnes