Skip to content

Add type argument to st.popover to match st.button#12598

Merged
sfc-gh-tteixeira merged 4 commits intodevelopfrom
popover-type
Sep 22, 2025
Merged

Add type argument to st.popover to match st.button#12598
sfc-gh-tteixeira merged 4 commits intodevelopfrom
popover-type

Conversation

@sfc-gh-tteixeira
Copy link
Copy Markdown
Contributor

@sfc-gh-tteixeira sfc-gh-tteixeira commented Sep 22, 2025

Describe your changes

The st.popover command currently inserts a button in your app which shows a popover when clicked. However, unlike a regular st.button, that button cannot be styled as primary/secondary/tertiary.

This PR fixes that. This adds type="primary"|"secondary"|"tertiary" to st.popover.

GitHub Issue Link (if applicable)

Closes #10416

Testing Plan

  • Explanation of why no additional tests are needed
  • Unit Tests (JS and/or Python)
  • E2E Tests
  • Any manual testing needed?

Contribution License Agreement

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

@sfc-gh-tteixeira sfc-gh-tteixeira requested a review from a team as a code owner September 22, 2025 16:12
@snyk-io
Copy link
Copy Markdown
Contributor

snyk-io bot commented Sep 22, 2025

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

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Sep 22, 2025

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-12598/streamlit-1.49.1-py3-none-any.whl
🕹️ Preview app pr-12598.streamlit.app (☁️ Deploy here if not accessible)

sfc-gh-tteixeira and others added 3 commits September 22, 2025 09:52
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
self,
label: str,
*,
type: Literal["primary", "secondary", "tertiary"] = "secondary",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The type parameter already includes the correct type annotation Literal["primary", "secondary", "tertiary"] with default value "secondary". The comment appears to be incorrect as the type annotation is present in the code.

Spotted by Diamond (based on custom rule: Python Guide)

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@sfc-gh-tteixeira sfc-gh-tteixeira enabled auto-merge (squash) September 22, 2025 17:58
@jrieke
Copy link
Copy Markdown
Collaborator

jrieke commented Sep 22, 2025

Love it, go ahead! (Look who filed #10416 😉 )

@sfc-gh-bnisco sfc-gh-bnisco added security-assessment-completed change:feature PR contains new feature or enhancement implementation impact:users PR changes affect end users labels Sep 22, 2025
@sfc-gh-tteixeira sfc-gh-tteixeira merged commit efde4e2 into develop Sep 22, 2025
43 of 44 checks passed
@sfc-gh-tteixeira sfc-gh-tteixeira deleted the popover-type branch September 22, 2025 19:51
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add primary/secondary/tertiary type to st.popover

3 participants