Use st.tabs to organize alternative content panels behind clickable titles. Pass a list of strings, and Streamlit creates one tab for each title. section 6.5.1
One chart per metric
A dashboard can create tabs from display_metrics: chart_tabs = st.tabs(display_metrics). Iterate through the metrics, select chart_tabs[idx], and place each metric’s Plotly line chart inside that tab with a with context manager. section 6.5.1
The basic pattern is:
- Prepare tab titles such as ["Home", "About us", "Careers"] or a list of dashboard metrics. section 6.5.1
- Call st.tabs with those titles and use the returned tab objects by index. section 6.5.1
- Render the appropriate content inside each selected tab. section 6.5.1
