Docs for auto-extracting icons#14458
Conversation
|
Thanks for contributing to Streamlit! 🎈 Please make sure you have read our Contributing Guide. You can find additional information about Streamlit development in the wiki. The review process:
We're receiving many contributions and have limited review bandwidth — please expect some delay. We appreciate your patience! 🙏 |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Pull request overview
This PR updates the public API docstrings for Streamlit alert elements (st.error, st.warning, st.info, st.success) to explain the “auto-extract leading icon from body” behavior and how users can override it.
Changes:
- Documented how leading emoji / Material icon shortcodes can be auto-extracted from
bodywhenicon=None. - Added guidance for overriding auto-extraction when the body contains multiple icons.
- Tweaked the documented
iconparameter type notation.

Describe your changes
This PR explains the behavior of auto-extracting icons in status elements and how to override it (which might be needed when there are multiple icons in the body/label).
Per testing, this change doesn't seem to apply to toast yet, so that's not included.
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.