Spaces:
Running
Running
File size: 616 Bytes
9d075d8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import gradio as gr
def greet(name):
return "Hello " + name + "!"
with gr.Blocks() as demo:
with gr.Tabs():
with gr.TabItem("Tab 1"):
t = gr.Textbox("Some value", label="Name", visible=False)
btn = gr.Button("Show")
btn.click(lambda: gr.Textbox(visible=True), inputs=None, outputs=t)
with gr.TabItem("Tab 2"):
t2 = gr.Textbox("Some other value", label="Name", visible=False)
btn2 = gr.Button("Show")
btn2.click(lambda: gr.Textbox(visible=True), inputs=None, outputs=t2)
if __name__ == "__main__":
demo.launch()
|