Search⌘ K
AI Features

Tab in Gradio

Explore how to use the Tab layout element in Gradio to create customizable tabbed interfaces, including nested tabs and event listeners. Understand the difference between Tab and TabbedInterface and learn how to trigger actions when tabs are selected to enhance user interaction within your machine learning applications.

Tab

Tab is a layout element that allows components defined within it to be part of a selected tab. This allows us to create tabs in our UI, much like using multiple tabs in our web browsers.

To use Tab, we can instantiate within a context, just like Row and Column.

with  gr.Tab ("[Tab name]"):

Tab vs. TabbedInterface

Previously we covered the TabbedInterface, which also allowed us to create tabs. Why would we need to use a Tab when we can use TabbedInterface? Let’s explore it below.

Customizable layout

Tab is a more low-level method of creating tabs, and makes it easier to customize ...