Skip to content

Instantly share code, notes, and snippets.

@ahmedbesbes
Created July 23, 2022 20:10
Show Gist options
  • Save ahmedbesbes/3e1a23c1b5c5da4a55f725c3b73628fd to your computer and use it in GitHub Desktop.
Save ahmedbesbes/3e1a23c1b5c5da4a55f725c3b73628fd to your computer and use it in GitHub Desktop.
import streamlit as st
number_of_tabs = st.sidebar.number_input(
"Number of tabs",
min_value=1,
max_value=20,
value=1,
)
number_of_tabs = int(number_of_tabs)
tabs = st.tabs([f"tab {i+1}" for i in range(number_of_tabs)])
for i in range(number_of_tabs):
with tabs[i]:
st.subheader(f"this is tab {i+1}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment