A navigation component to move between different views within the same page hierarchy.

Importing

The components can be imported via:

import { 
    TabNav, 
    TabNavList, 
    TabNavTab 
} from '@customerio/pluma-components/react';

For a tabbed navigation interface that consists of links, use PlumaTabNav. Similar to PlumaTabs, it accepts a tabs array of objects, though with a slightly altered interface. Instead of a value, the tab items require a href string with the target URL.

An activeTab value may be provided to TabNav, where the value should match the href of the active tab. Alternatively, isActive may be set on the tab object itself.

PlumaTabsPanel components are not necessary in this case, because the tabs are meant to navigate to different URLs, where the "tab content" is rendered via the routing library's outlet.

<TabNav
	tabs={[
		{ href: '#', text: 'Campaigns' },
		{ href: '#', text: 'Newsletters', isActive: true },
		{ href: '#', text: 'API Triggered Broadcasts' },
		{ href: '#', text: 'Transactional Messages' },
	]}
/>

PlumaTabNav supports the same options as PlumaTabs, including:

  • icons
  • badges
  • disabling tabs
  • panel variant
  • custom tabs
<TabNav
	tabs={[
		{ 
			href: '#', 
			text: 'Campaigns',
			icon: 'campaigns',
			badge: '123',
		},
		{ 
			href: '#', 
			text: 'Newsletters',
			icon: 'newsletter',
			isActive: true,
			badge: '5',
		},
		{ 
			href: '#', 
			text: 'Transactional Messages',
			icon: 'transactional-api',
			iconColor: 'caution',
		},
	]}    
/>

API

The currently active tab (the tab href to match a value from the tabs prop). This prop is optional: isActive may be specified on the tab items themselves.

Default:false

Whether the tab list should render without a border.

Whether all tabs should be disabled.

Array of tab items to display.

The alignInline argument passed through to the TabsList component. Controls alignment of the tabs in the inline axis.

Additional classes to apply to any of the tabs (each array item corresponding to the tabs array).

What style of tab to render.

On this page