Tabs
Tabs allow the user to interact across the sections to switch from one set of content to another, making the transition easily from one peer to the other.
Name | Type | Description | Default |
---|---|---|---|
Legacy | number | Initially active tab, only when it is uncontrolled. | - |
Legacy | number | The index of the active tab. If undefined, the component will be uncontrolled and the active tab will be managed internally by the component. | - |
Legacy | { label: string, icon: string | (React.ReactNode & React.SVGProps <SVGSVGElement>), isDisabled: boolean, notificationNumber: boolean | number }[] | An array of objects representing the tabs. Each of them has the following properties:
| - |
Experimental | React.ReactNode | Contains one or more DxcTabs.Tab . | - |
iconPosition | 'top' | 'left' | Whether the icon should appear above or to the left of the label. | 'top' |
Legacy | (index: number) => void | This function will be called when the user clicks on a tab. The index of the clicked tab will be passed as a parameter. | - |
Legacy | (index: number) => void | This function will be called when the user hovers a tab. The index of the hovered tab will be passed as a parameter. | - |
margin | 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | Margin | Size of the margin to be applied to the component. You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes. | - |
tabIndex | number | Value of the tabindex attribute applied to each tab. | 0 |
Single tab, part of the set of Tabs.
Name | Type | Description | Default |
---|---|---|---|
active | boolean | Whether the tab is active or not. | false |
defaultActive | boolean | Whether the tab is active or not by default, but mantaining the uncontrolled behaviour. | false |
disabled | boolean | Whether the tab is disabled or not. | false |
Required | string | Tab label text. | - |
title | string | Tooltip text for the tab. | - |
icon | string | (React.ReactNode & React.SVGProps <SVGSVGElement>) | Material Symbol name or SVG element as the icon that will be displayed in the tab. When using Material Symbols, replace spaces with underscores. By default they are outlined if you want it to be filled prefix the symbol name with "filled_" . | - |
onClick | () => void | This function will be called when the user clicks on this tab. | - |
onHover | () => void | This function will be called when the user hovers this tab. | - |
notificationNumber | boolean | number | If true, an empty badge will appear. If false or if the tab is disabled, no badge will appear. If a number is specified, the component will display a badge with the value as its label. Take into account that if that number is greater than 99, it will appear as +99 in the badge. | false |
Required | React.ReactNode | Contains the component to be rendered when this tab is active. | - |