Skip to main content

Tabs

The Tabs component provides a tabbed interface to display different content sections. Each Tab contains a heading and content. Below you will find detailed information about its props and how to use it.

Props

Tab

PropTypeDefaultDescription
headingJSX.ElementRequiredThe element to display as the tab heading.
childrenReact.ReactNodeRequiredThe content to display within the tab.
disabledbooleanfalseIf true, the tab will be disabled and unclickable.
activebooleanfalseIf true, the tab will be active initially.

Tabs

PropTypeDefaultDescription
childrenReact.ReactElement<TabProps>[]RequiredAn array of Tab elements to display in the tabbed interface.

Example Usage

Basic Tabs

import React from 'react';
import { Tab, Tabs } from '@ginger-society/ginger-ui';

export const TabsExample: React.FC = () => {
return (
<Tabs>
<Tab heading={<span>Tab 1</span>}>
<div>Content for Tab 1</div>
</Tab>
<Tab heading={<span>Tab 2</span>} active>
<div>Content for Tab 2</div>
</Tab>
<Tab heading={<span>Tab 3</span>} disabled>
<div>Content for Tab 3</div>
</Tab>
</Tabs>
);
};
Content for Tab 1