Tab components allow you display content in multiple pages within a container. These page are organized by a tab list and the corresponding tab panel can take in children components if needed.
Text from tab 1.
rc.tabs(
rc.tab_list(
rc.tab("Tab 1"),
rc.tab("Tab 2"),
rc.tab("Tab 3"),
),
rc.tab_panels(
rc.tab_panel(rc.text("Text from tab 1.")),
rc.tab_panel(rc.checkbox("Text from tab 2.")),
rc.tab_panel(
rc.button("Text from tab 3.", color="black")
),
),
bg="black",
color="white",
shadow="lg",
)
You can create a tab component using the shorthand syntax.
Pass a list of tuples to the items
prop.
Each tuple should contain a label and a panel.
Text from tab 1.
rc.tabs(
items=[
("Tab 1", rc.text("Text from tab 1.")),
("Tab 2", rc.checkbox("Text from tab 2.")),
(
"Tab 3",
rc.button("Text from tab 3.", color="black"),
),
],
bg="black",
color="white",
shadow="lg",
)
rc.Tabs
An accessible tabs component that provides keyboard interactions and ARIA attributes described in the WAI-ARIA Tabs Design Pattern. Tabs, provides context and state for all components.
Event Triggers
See the full list of default event triggersrc.TabList
Wrapper for the Tab components.
Props
No component specific props
Event Triggers
See the full list of default event triggersrc.Tab
An element that serves as a label for one of the tab panels and can be activated to display that panel..
Event Triggers
See the full list of default event triggersrc.TabPanel
An element that contains the content associated with a tab.
Props
No component specific props
Event Triggers
See the full list of default event triggersrc.TabPanels
Wrapper for the Tab components.
Props
No component specific props