Guide
Components
Tabs

Tabs Component

ℹ️

The Tabs component is a React component designed for creating tabbed interfaces with various styles and sizes.

Example Preview

Tabs Component Preview

Usage

Import the Tabs component and use it in your React application:

import { Tabs } from "@/@core";
 
const MyTabsComponent = () => {
  const tabsData = [
    {
      label: "Tab 1",
      content: <div>Content for Tab 1</div>,
    },
    {
      label: "Tab 2",
      content: <div>Content for Tab 2</div>,
    },
    {
      label: "Tab 3",
      content: <div>Content for Tab 3</div>,
    },
  ];
 
  return <Tabs tabs={tabsData} />;
};
 
export default MyTabsComponent;

Props

PropTypeDefaultDescription
tabsArray<{ label: string; content: React.ReactNode }>See exampleArray of objects representing tabs, each containing a label and corresponding content.
variantbordered, lifted, boxedborderedStyle variant for the tabs.
sizexs, sm, md, lgmdSize variant for the tabs.
btnBodyClassNameHTMLDivElement['className']-Additional class name for the tab button container.
btnClassNameHTMLDivElement['className']-Additional class name for the tab buttons.
activeBtnClassNameHTMLDivElement['className']-Additional class name for the active tab button.

Additional Props

Refer to the HTMLAttributes<HTMLDivElement> interface for standard HTML div element attributes.

ℹ️

Note: The Tabs component uses the HTMLDivElement element under the hood. You can pass any of the standard HTML div element attributes to the component. For example, you can pass the className prop to add a custom class name to the component. You can also pass the style prop to add custom styles to the component. Refer to the React documentation (opens in a new tab) for a list of all supported HTML div element attributes.