-
Notifications
You must be signed in to change notification settings - Fork 4k
Description
Checklist
- I have searched the existing issues for similar feature requests.
- I added a descriptive title and summary to this issue.
Summary
Add the ability to configure the default sidebar width in config.toml.
Why?
The default sidebar width was changed in Streamlit 1.46.0, which can affects apps that rely on a wider sidebar for layout consistency. In my case, I have buttons and other elements in the sidebar that now appear squished with the new default.
While it’s possible to override the sidebar width using custom HTML like:
[data-testid="stSidebar"] { width: 400px; } or
[data-testid="stSidebar"] { min-width: 400px; max-width: 800px; } this approach has limitations.
It might not persist smoothly across pages in multipage apps if you reload the sidebar — making it flashe from default to custom width on every navigation. Also, it seems more like a workaround rather than a native solution.
How?
Ideally, it would be nice to support a config option such as:
sidebar-default-width = 400 # width in px
Additional Context
Related code:
| const DEFAULT_WIDTH = "256" |
Related discussions:
https://discuss.streamlit.io/t/release-1-46-0/115727/7