Use scrollOffset to allow the Tabs to scroll from edge to edge in narrow screen sizes. Pass the same value used for page side paddings to scrollOffset.
<Tabs
scrollOffset="var(--livePreviewPadding)"
tabs={demoText.ordinals.map((title, index)=>({
tabContent: title,
isActive: index ===0,
}))}
/>
Full tabs
<Tabs
hasFullTabs
tabs={[
{tabContent:'Full',isActive:true},
{tabContent:'Width'},
{tabContent:'Tabs'},
]}
/>
Bottom border
This style is commonly used in full-page layouts, where scrolling may be required. The underline acts as a divider, clearly separating the navigation from the main content and guiding users across the tab options.
You can add tooltips to individual tabs by providing tooltipProps to any tab item. This is useful for providing additional context or explanations for tab functionality.
<Tabs
tabs={[
{
tabContent:'Overview',
isActive:true,
tooltipProps:{
content:'View general information and statistics'
}
},
{
tabContent:'Settings',
tooltipProps:{
content:'Configure your preferences and options',
placement:'top'
}
},
{
tabContent:'Help',
icon:<SvgRecord/>,
tooltipProps:{
content:'Get help and support resources',
placement:'bottom'
}
},
]}
/>
With React Router
Use React Router Link components as tabContent. Additionally add tabIndex=-1 and onClick as shown below to ensure keyboard support.
This legacy approach to defining tabs is deprecated and should not be used in new code. The structure shown below does not meet accessibility standards and lacks proper keyboard navigation and screen reader support.
Previously, we exposed both <Tabs> and <Tab> components and allowed developers to manually structure the tab layout. This approach has been deprecated in favor of the current tabs prop pattern, which ensures proper accessibility and consistent behavior across all implementations.