I came up with this rule to help LLMs write code without the warning:
2025-09-25 12:18:38.722 Please replace use_container_width with width. use_container_width will be removed after 2025-12-31. For use_container_width=True, use width='stretch'. For use_container_width=False, use width='content'.
Prompt:
- Always replace deprecated use_container_width with width: use width="stretch" if use_container_width=True, and width="content" if use_container_width=False, across all Streamlit components (st.dataframe, st.data_editor, st.image, st.pyplot, st.plotly_chart, st.button, st.download_button, st.link_button, st.graphviz_chart).
I have Cursor pointed to the Streamlit Docs but was constantly getting those warnings.
Any suggestions for improvement?
