A navigation component to move between different views within the same page hierarchy.
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.
PlumaTabNav supports the same options as PlumaTabs, including:
iconSrcpanel variantPlumaTabNav extends TabsThe 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:'nav'
What element or component should be rendered.
Array of tab items to display.
Text content to show in a badge inside the tab.
The URL for the tab's link.
An icon to show in the tab.
A color to apply to the icon. Ignored when iconSrc is set.
The source URL of a custom image icon to render in the tab, in place of icon.
When provided, this will be rendered using the Image component with icon sizing.
The image will always have alt="" as it is purely decorative - meaning comes from the tab text.
Default:true
Only applies when iconSrc is provided.
Whether the image should be rendered with a bounding box to match the size of a Pluma Icon.
For certain cases, such as a logo, you may want to set this to false to allow the image to render
at a larger size without the additional padding.
Whether this tab is currently active/selected.
Whether this tab is disabled.
The text content to show in the tab.
PlumaTabNavList extends InlineStackDefault:'div'
What element or component should be rendered.
Array of tab items to display.
Additional classes to apply to any of the tabs
(each array item corresponding to the tabs array).
PlumaTabNavTab extends BoxDefault:'div'
What element or component should be rendered.
Text content to show in a badge inside the tab.
The URL for the tab's link.
An icon to show in the tab.
A color to apply to the icon. Ignored when iconSrc is set.
The source URL of a custom image icon to render in the tab, in place of icon.
When provided, this will be rendered using the Image component with icon sizing.
The image will always have alt="" as it is purely decorative - meaning comes from the tab text.
Default:true
Only applies when iconSrc is provided.
Whether the image should be rendered with a bounding box to match the size of a Pluma Icon.
For certain cases, such as a logo, you may want to set this to false to allow the image to render
at a larger size without the additional padding.
Whether this tab is currently active/selected.
Whether this tab is disabled.
When this flag is true, an a tag will be used instead of the provider's linkComponent, even if it exists.
Additionally, target="_blank" rel="noopener noreferrer" will be added automatically
This is passed into the provider's linkComponent.
It can be used by the link component implementation to handle replaceState instead of pushState
This allows turning off the automatic addition of target="_blank" rel="noopener noreferrer".
This can be used for links to other protocols like mailto: