-
Notifications
You must be signed in to change notification settings - Fork 4k
Add support for setting spinner as icon
#13045
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ 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. |
✅ PR preview is ready!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
sfc-gh-lwilby
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.