Introducing Gradio Clients

Watch

New to Gradio? Start here: Getting Started

See the Release History

Tab

gradio.Tab(···)

Description

Tab (or its alias TabItem) is a layout element. Components defined within the Tab will be visible when this tab is selected tab.

Example Usage

with gr.Blocks() as demo:
    with gr.Tab("Lion"):
        gr.Image("lion.jpg")
        gr.Button("New Lion")
    with gr.Tab("Tiger"):
        gr.Image("tiger.jpg")
        gr.Button("New Tiger")

Initialization

Parameters

Methods

select

gradio.Tab.select(···)

Description

Event listener for when the user selects or deselects the Tab. Uses event data gradio.SelectData to carry `value` referring to the label of the Tab, and `selected` to refer to state of the Tab. See EventData documentation on how to use this event data

Parameters

Guides