TabsProps
Interface: TabsProps
Defined in: src/components/Tabs.tsx:61
Props for the Tabs
tabs
array of Tab
activeTab
tab currently active, needs to be one of the tabs Tab.id, must be set using a useState
in the onShowTab
handler
onShowTab
Called when the active tab should change, needs to set activeTab
. See example.
autoFocusContents
Whether to automatically focus the tab contents or not.
footer
Sets up button handlers and labels
Example
const Component: FC = () => {
const [currentTab, setCurrentTab] = useState<string>("Tab1");
return (
<Tabs
title="Theme Manager"
activeTab={currentTabRoute}
onShowTab={(tabID: string) => {
setCurrentTabRoute(tabID);
}}
tabs={[
{
title: "Tab 1",
content: <Tab1Component />,
id: "Tab1",
},
{
title: "Tab 2",
content: <Tab2Component />,
id: "Tab2",
},
]}
/>
);
};
Properties
activeTab
activeTab: string;
Defined in: src/components/Tabs.tsx:63
autoFocusContents?
optional autoFocusContents: boolean;
Defined in: src/components/Tabs.tsx:65
onShowTab()
onShowTab: (tab: string) => void;
Defined in: src/components/Tabs.tsx:64
Parameters
tab
string
Returns
void
tabs
tabs: Tab[];
Defined in: src/components/Tabs.tsx:62