Skip to content

Replace use_container_width with width, and pin streamlit - #1

Merged
scaso01 merged 1 commit into
mainfrom
streamlit-width-rename
Jul 30, 2026
Merged

Replace use_container_width with width, and pin streamlit#1
scaso01 merged 1 commit into
mainfrom
streamlit-width-rename

Conversation

@scaso01

@scaso01 scaso01 commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Streamlit renamed use_container_width and scheduled the old name for removal on 2025-12-31, a date that has already passed. It still works and only logs a warning, but this package declared streamlit>=1.30.0 with no upper bound, so any future release could drop it and stop every chart, table and full-width button from rendering.

All 9 sites were use_container_width=True on st.plotly_chart, st.dataframe or st.button, the three widgets where width="stretch" is the documented replacement. Found with an AST walk rather than a grep, so a call spanning several lines could not be missed, and st.image was confirmed absent: width there used to mean a pixel count.

The floor moves to 1.60.0 because width is not accepted by the older releases the old floor allowed, so swapping the flag without raising it would have broken installs that were previously fine. Capped below 2.0 so a major release cannot silently change widget APIs again.

Local run: 212 passed, including the 10 dashboard tests that render the real app through AppTest.

Streamlit renamed this flag and scheduled the old name for removal on
2025-12-31, a date that has already passed. It still works and only logs a
warning, but this package declared "streamlit>=1.30.0" with no upper bound,
so any future release could drop the old name and stop every chart, table
and full-width button from rendering.

All 9 sites were use_container_width=True on st.plotly_chart, st.dataframe
or st.button, the three widgets where width="stretch" is the documented
replacement. Found with an AST walk rather than a grep, so a call spanning
several lines could not be missed, and st.image was confirmed absent: width
there used to mean a pixel count.

The floor moves to 1.60.0 because width is not accepted by the older
releases the old floor allowed, so swapping the flag without raising it
would have broken installs that were previously fine. Verified against
1.60.0, which is what is installed here. Capped below 2.0 so a major release
cannot silently change widget APIs again.

212 passed, including the 10 dashboard tests that render the real app
through AppTest.
@scaso01
scaso01 merged commit bad87b2 into main Jul 30, 2026
3 checks passed
@scaso01
scaso01 deleted the streamlit-width-rename branch July 30, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant