Add support for setting spinner as icon#13045
Merged
lukasmasuch merged 5 commits intodevelopfrom Nov 19, 2025
Merged
Conversation
Contributor
✅ 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. |
Contributor
✅ PR preview is ready!
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for using "spinner" as a special icon value across all Streamlit elements and widgets that support the icon parameter. This addresses a user feature request to display animated spinner icons in UI elements.
- Added validation logic in
string_util.pyto recognize and allow"spinner"as a valid icon value - Updated documentation for all icon-supporting elements to include the new spinner option
- Added unit tests and E2E tests to verify the spinner icon functionality
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/streamlit/string_util.py | Added special-case handling for "spinner" icon in validate_icon_or_emoji() function |
| lib/tests/streamlit/string_util_test.py | Added unit tests for spinner icon validation |
| lib/streamlit/elements/alert.py | Added spinner icon documentation to error(), warning(), info(), and success() |
| lib/streamlit/elements/form.py | Added spinner icon documentation to form_submit_button() |
| lib/streamlit/elements/layouts.py | Added spinner icon documentation to expander() and popover() |
| lib/streamlit/elements/toast.py | Added spinner icon documentation to toast() |
| lib/streamlit/elements/widgets/button.py | Added spinner icon documentation to button(), download_button(), link_button(), and page_link() |
| lib/streamlit/elements/widgets/chat.py | Added spinner icon documentation to chat_message() |
| lib/streamlit/elements/widgets/number_input.py | Added spinner icon documentation to number_input() |
| lib/streamlit/elements/widgets/text_widgets.py | Added spinner icon documentation to text_input() |
| lib/streamlit/navigation/page.py | Added spinner icon documentation to Page() |
| e2e_playwright/st_button.py | Added test button with spinner icon to E2E test app |
| e2e_playwright/st_button_test.py | Added E2E test to verify spinner icon renders correctly |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
Adds support for setting a spinner icon wherever we support the
iconparameter (buttons, alerts, number input, ...).GitHub Issue Link (if applicable)
Testing Plan
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.