How can i use tabs as an input?
I’m creating some tabs and when i click a button i want to use the name of the tabs as an input for a function. How does it work? Thank you very much!My way of creating tabs would be for example this, with blocks:with gr.Tabs() as tabs:
                with gr.TabItem("test1"):
                    bt_test1 = gr.Button('test1')
                with gr.TabItem("test2"):   
                    bt_test2 = gr.Button('test2')
2023-01-21T02:50:39Z
You can use theselect()event listener thatTabItem(which also has the aliasTab) supports:import gradio as gr

with gr.Blocks() as demo:
    with gr.Tabs():
        with gr.Tab("hi") as hi:
            pass
        with gr.Tab("hello") as hello:
            pass
        
    output = gr.Textbox()
    hi.select(lambda :"hi", None, output)
    hello.select(lambda :"hello", None, output) 
    
demo.launch()