Skip to content

Conversation

@lukasmasuch
Copy link
Collaborator

@lukasmasuch lukasmasuch commented Nov 19, 2025

Describe your changes

Adds support for setting a spinner icon wherever we support the icon parameter (buttons, alerts, number input, ...).

GitHub Issue Link (if applicable)

Testing Plan

  • Add unit test and e2e test.

Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@snyk-io
Copy link
Contributor

snyk-io bot commented Nov 19, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 19, 2025

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-13045/streamlit-1.51.0-py3-none-any.whl
📦 @streamlit/component-v2-lib Download from artifacts
🕹️ Preview app pr-13045.streamlit.app (☁️ Deploy here if not accessible)

@lukasmasuch lukasmasuch added security-assessment-completed Security assessment has been completed for PR change:feature PR contains new feature or enhancement implementation impact:users PR changes affect end users labels Nov 19, 2025
@lukasmasuch lukasmasuch marked this pull request as ready for review November 19, 2025 01:00
@lukasmasuch lukasmasuch requested a review from Copilot November 19, 2025 01:02
Copy link
Contributor

Copilot AI left a 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.py to 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

Copy link
Collaborator

@sfc-gh-lwilby sfc-gh-lwilby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lukasmasuch lukasmasuch merged commit 27584fb into develop Nov 19, 2025
40 checks passed
@lukasmasuch lukasmasuch deleted the feature/support-spinner-icons branch November 19, 2025 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:feature PR contains new feature or enhancement implementation impact:users PR changes affect end users security-assessment-completed Security assessment has been completed for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support isLoading on buttons

3 participants