Skip to Content

Tabs

The tabs component is a simple way to organize content into different sections.

Examples

Basic Usage

Tab Adornments

Each Tab accepts start and end adornments for icons or counts. Added in 10.0.0.

<TabList> <Tab start={<InboxIcon />}>Inbox</Tab> <Tab end={<Badge>12</Badge>}>Notifications</Tab> </TabList>

Blocks

This component is used in the following Blocks:

Theme

This component uses the following default theme:

  • root{}(3 keys)
      Show all

Learn more about how to customize in the Theme documentation.

API

Tabs

NameTypeDefault
classNamestring

The class name to be added to the tabs.

selectedIndexnumber

The active index of the tabs.

defaultIndexnumber

The default index of the tabs. Default is 0.

0
direction"ltr" | "rtl"

The direction of the tabs. Default is ‘ltr’.

'ltr'
styleCSSProperties

The style to be added to the tabs.

variant"primary" | "secondary"

The variant of the tabs.

'primary'
sizestring

The size of the tabs.

'medium'
onSelect(index: number) => void

The callback to be called when a tab is selected.

themeTabsTheme

Theme for the Tabs.

TabList

NameTypeDefault
idstring

The id of the tab list.

classNamestring

The class name to be added to the tab list.

selectedIndexnumber

The active index of the tabs.

direction"ltr" | "rtl"

The direction of the tabs. Default is ‘ltr’.

onSelect(index: number) => void

The callback to be called when a tab is selected.

variant"primary" | "secondary"

The variant of the tabs.

'primary'
sizestring

The size of the tabs.

'medium'
themeTabsTheme

Theme for the Tabs.

Tab

NameTypeDefault
idstring

The id of the tab list.

containerClassNamestring

The class name to be added to the tab container.

classNamestring

The class name to be added to the tab.

disabledboolean

The disabled state of the tab.

selectedboolean

The selected state of the tab.

onSelect() => void

The callback to be called when the tab is selected.

startReactElement<unknown, string | JSXElementConstructor<any>>

Element to display before the Button content.

endReactElement<unknown, string | JSXElementConstructor<any>>

Element to display after the Button content.

sizestring

The size of the tabs.

'medium'
themeTabsTheme

Theme for the Tabs.

TabPanel

NameTypeDefault
classNamestring

The class name to be added to the tab panel.

themeTabsTheme

Theme for the Tabs.

Last updated on