Update Tabs Titles

Is it possible to update the title of a tab once it has been created?

I am generating a list of tabs at runtime, and I would like to update the titles.

Pages don’t work as each tab is being updated asynchronously in the background so I need them all running all the time.

container=[]
titles=[]
tab = st.tabs(["Meeting 1", "Meeting 2", "Meeting 3","Meeting 4"])
    for idx, x in enumerate(tab):
        
        with tab[idx]:
            titles.append(st.header(""))
            container.append(st.empty())
            
        container[idx].text("Waiting for %s" %idx)

Hi @jumpers4,

Is this what you are looking for?

import streamlit as st

if "taboptns" not in st.session_state:
    st.session_state.taboptns = ["Meeting 1", "Meeting 2", "Meeting 3"]  

def btn_callback():
    if st.session_state.taboptns[0] == "Meeting 4": # toggle tab set
        st.session_state.taboptns = ["Meeting 1", "Meeting 2", "Meeting 3"] 
    else:
        st.session_state.taboptns = ["Meeting 4", "Meeting 5", "Meeting 6"]


def MyTabsPage():
    tabs = st.tabs(st.session_state.taboptns)

    tabs[0].header(st.session_state.taboptns[0])
    tabs[1].header(st.session_state.taboptns[1])
    tabs[2].header(st.session_state.taboptns[2])

    if st.button("Change Tabs", on_click=btn_callback):
        st.write("Tabs have been changed.")

if 'runpage' not in st.session_state:
    st.session_state.runpage = MyTabsPage

st.session_state.runpage()

Additionally, have a look at @Rushmore 's work ( Socvest/streamlit-dynamic-tabs: Create and close tabs (github.com))

Cheers

Perfect - I can see the way forward now!