Tabs
A set of layered sections of content—known as tab panels—that are displayed one at a time.
Installation
Command to install the Tabs component.
Component Guide
Use the following to build the Tabs component.
from components.ui.tabs import tabsSource Code & Dependencies
For manual installation, copy each of the source codes below in their respective locations.
components/core/core.py
components/ui/tabs.py
Examples
Basic
Line
Use the variant="line" prop on tabs.list for a line style.
Vertical
Use orientation="vertical" for vertical tabs.
Disabled
Use disabled=True to disable a tab.
Icons
API Reference
tabs.root
The main container component that initializes your tab instance, holds the active state configuration on the client, and dictates the layout orientation.
tabs.root(
tabs.list(
tabs.trigger("Overview", value="overview"),
tabs.trigger("Analytics", value="analytics"),
),
tabs.content(
"Overview panel data",
value="overview"
),
default_value="overview",
)
tabs.list
Groups the trigger navigation buttons together and controls the visual theme style.
tabs.list(
tabs.trigger("Tab 1", value="tab1"),
tabs.trigger("Tab 2", value="tab2"),
variant="line",
)
tabs.trigger
The clickable button elements used to switch active states. They safely merge internal client-side JS actions with optional user-supplied events.
tabs.trigger(
"Analytics",
value="analytics",
on_click=rx.console_log("Switched tabs!")
)
tabs.content
The structural panel containing content mapped to a specific tab trigger value. Toggles layout visibility instantly purely using CSS attribute matching.
tabs.content(
"Your dashboard analytics modules go here.",
value="analytics",
)