Enhancement/update dropdown design #12956#13004
Enhancement/update dropdown design #12956#13004sfc-gh-nbellante merged 11 commits intostreamlit:developfrom
Conversation
- Apply theme.radii.xl border-radius for rounded corners - Add conditional box-shadow based on light/dark theme - Implement consistent 1px solid borders - Update item highlighting with rounded ::before pseudo-element - Optimize padding structure to prevent horizontal scrollbar - Use theme.zIndices for proper layering
✅ 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. |
|
This looks great! Got a few comments so far. What we should definitely change:
What I'm unsure about, will add our designer @shamis15 to this discussion:
|
|
Could you maybe also put a small public demo app of this on Community Cloud and post the link here? That would make it a bit easier for our designer to look at it live :) |
|
Thanks a lot for the feedback! I’ve pushed a couple of updates and set up a small public demo app so it’s easier to review the styling live. Changes since your last comments:
Open questions for design:
@jrieke , @shamis15 would love your thoughts on the current look in the demo app. Once we’re aligned on border and spacing, I can polish anything remaining and then we can consider rolling this out to other dropdown-based widgets as a follow-up. |
|
Hi! Yes I will handle the design later this week and get back to you! Thank you so much! |
|
Hi @shamis15, @jrieke! Just wanted to gently follow up on this. No rush—just wanted to make sure this stays on your radar. Happy to make any adjustments once I hear back on the border/spacing questions! 😊 |
|
@cursor review |
|
Hey @sfc-gh-jrieke @shamis15, |
|
Hi! @rishi-kumar0612 Sorry I was on leave and then vacation! Here is the updated design. It will be in the form of a figma file so let me know if that works for you or if not I can just give you a screenshot with all the specs :) thanks again for the contribution - I love the new design. |
|
Hi @shamis15! Welcome back and a Happy New Yeat🎉 Thanks for the Figma file - it works perfectly! I've reviewed the design specs and they look great. I'll update the implementation to match exactly and push the changes shortly. Quick question: The design shows 16px font size for dropdown options and borders in both themes - confirming this is correct? Thanks again for the detailed specs! Will have the updates ready soon. 😊 |
There was a problem hiding this comment.
Pull request overview
This PR enhances the visual design of the selectbox dropdown by applying consistent styling that matches Streamlit's top navigation dropdowns, ensuring a cohesive user experience across all dropdown components.
Key Changes
- Applied rounded corners (
theme.radii.xl) to dropdown containers and list items - Implemented theme-conditional box shadows for light and dark modes
- Enhanced dropdown item highlighting with rounded backgrounds using
::beforepseudo-elements and proper z-index layering - Updated padding structure to prevent horizontal scrollbars while maintaining visual spacing
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
frontend/lib/src/components/shared/Dropdown/styled-components.ts |
Enhanced dropdown list item styling with rounded corners, background highlighting using pseudo-elements, z-index layering, and forced transparency on BaseWeb inner wrappers |
frontend/lib/src/components/shared/Dropdown/VirtualDropdown.tsx |
Updated container padding from zero to theme.spacing.sm and added overflow control properties |
frontend/lib/src/components/shared/Dropdown/Selectbox.tsx |
Applied comprehensive styling to Popover Body with rounded corners, theme-conditional shadows, borders, overflow control, and updated dropdown component styles |
| // Somehow this adds an additional shadow, even though we already have | ||
| // one on the popover, so we need to remove it here. | ||
| boxShadow: "none", | ||
| overflow: "hidden", |
There was a problem hiding this comment.
The overflow: "hidden" properties are set on both the parent container (Popover Body) and the VirtualDropdown component. Setting overflowX: "hidden" and overflowY: "auto" separately when overflow: "hidden" is already set creates conflicting overflow rules. Consider removing the redundant overflow: "hidden" on line 122 since lines 123-124 provide more specific overflow control.
| overflow: "hidden", |
| "& *": { backgroundColor: "transparent !important" }, | ||
| "& [data-baseweb]": { backgroundColor: "transparent !important" }, |
There was a problem hiding this comment.
Using !important to override styles should generally be avoided as it makes the codebase harder to maintain and debug. While overriding third-party library styles (like BaseWeb) may sometimes require it, consider whether the BaseWeb override structure allows achieving the same result without !important, such as by using more specific selectors or overriding at a different level in the component hierarchy.
|
Hi @rishi-kumar0612. I was just wondering where you were on finishing this PR per the above comments. I have implemented select-all for |
|
I'm on it! Had some pre-planned work and got busy with it—I apologize for the delay. I will have the updates pushed by this weekend (Jan 18-19). Should be ready for review early next week. If you need to move faster for your select-all feature, feel free to go ahead and I can rebase on top of #13015 once it merges. The changes are fairly isolated so shouldn't cause major conflicts. Otherwise, I'll have this ready for you to pull by Monday/Tuesday. Let me know what works better for your timeline! 👍 Thankyou for your understanding |
|
@rishi-kumar0612 Hi again! 👋🏻 I just wanted to check in since I want to merge the select-all feature for |
…ithub.com/rishi-kumar0612/streamlit into enhancement/update-dropdown-design-#12956
|
Hi @sfc-gh-dmatthews, thanks for the nudge! I've just pushed the updates to align with the Figma specs provided by @shamis15. This is now ready for review so we can unblock the Updates in the latest commits:
Live Demo: Let me know if anything else is needed to get this merged! |
|
Hi @rishi-kumar0612 I think this looks great, just need to get some formatting ironed out and the snapshots updated. |
|
Hi @sfc-gh-nbellante, thank you for the feedback! I have ironed out the formatting and updated the E2E snapshots for the Selectbox and Multiselect components across Chromium, Firefox, and Webkit. |
|
Wohoo, thanks for getting this merged! @rishi-kumar0612 would love to send you some swag as a little thank you, feel free to fill out this form: https://docs.google.com/forms/d/e/1FAIpQLSe7cXh3H1DmrgNpVew9qViGIHX7vdEbTv5isA44_z5bgaKTKg/viewform?usp=send_form |
|
@jrieke thanks so much, |
|
@rishi-kumar0612 Just to let you know, the revert of your PR is just temporary. There was an issue completing the style for the other elements before the cutoff, so this was reverted in the release, but will stay in place for the next release when my PR joins it. 😄 Just letting you know. |

Describe your changes
Updated the selectbox dropdown styling to match the visual design of the top navigation dropdowns, ensuring a consistent user experience across all dropdown components in Streamlit.
Key changes:
theme.radii.xlborder-radius to dropdown container for rounded corners on all edges0px 4px 16px rgba(0, 0, 0, 0.16)for light,0px 4px 16px rgba(0, 0, 0, 0.7)for dark)theme.colors.borderColoracross all edges::beforepseudo-element and proper z-index layering (theme.zIndices.basefor background,theme.zIndices.priorityfor content)theme.spacing.smon container, no horizontal margins on items) to prevent horizontal scrollbar while maintaining proper visual spacingFiles modified:
frontend/lib/src/components/widgets/Selectbox/Selectbox.tsx- Updated Popover Body override with rounded corners, conditional shadow, and bordersfrontend/lib/src/components/shared/Dropdown/VirtualDropdown.tsx- Adjusted container padding totheme.spacing.smfor proper spacingfrontend/lib/src/components/shared/Dropdown/styled-components.ts- EnhancedThemedStyledDropdownListItemwith rounded highlight backgrounds using theme-based z-index values for proper layeringScreenshot or video (only for visual changes)
Dark Theme:
Before: Square corners, minimal elevation, basic border
After: Rounded corners (xl radius), prominent shadow for elevation, modern styling
Light Theme:
Before: Square corners, minimal elevation, basic border
After: Rounded corners (xl radius), subtle shadow for elevation, modern styling
Comparison with Top Navigation Dropdown
Both dropdowns now share consistent visual language: xl rounded corners, theme-conditional shadows, and uniform border styling
GitHub Issue Link (if applicable)
https://github.com/streamlit/streamlit/issues/12956
Related Issue
This PR addresses #12956 by implementing the new dropdown styling for
st.selectbox.cc @sfc-gh-nbellante @jrieke - This is the proof of concept we discussed. Ready for early feedback before expanding to other widgets!
Testing Plan
Explanation of why no additional tests are needed
This change is purely visual/styling and does not modify component behavior, functionality, props, or API. The existing component logic, user interactions, keyboard navigation, and accessibility features remain unchanged. All styling is applied through BaseUI override mechanisms and Emotion styled-components, which are well-established patterns in the Streamlit codebase. The component's functional behavior is already covered by existing tests.
Unit Tests (JS and/or Python)
JavaScript Tests:
VirtualDropdown.test.tsxandSelectbox.test.tsxTest Results:
E2E Tests
e2e/scripts/st_selectbox.pyAny manual testing needed?
Visual Consistency:
theme.radii.xlapplied uniformly to all cornersrgba(0,0,0,0.16), dark:rgba(0,0,0,0.7))theme.colors.borderColoron all edgesResponsive Behavior:
Interactive States:
theme.colors.darkenedBgMix15backgroundtheme.colors.darkenedBgMix25backgroundContribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.