Go Main page
Go Main page

Web components

cover

components

Tabs

v.1.0.0 | Saturn

Usage

1
import { Tabs } from '@kubit-ui-web/react-components';

Props

Let's delve into the versatility of the Tabs component by examining all its avalaible props.

Tabs UnControlled

PropertyTypeDefaultDescription
variant
Required
String-Variant
defaultSelectedTabNumber0Default tab selected
tabsPrimaryTabTabType-List of tabs
contentReactNode-Content for each tab
onSelectTab(index: Number) => void-onSelectTab callback
leftIconIElementOrIcon-Left icon of the tab
leftControlAriaLabelString-Left icon button aria-label
rightIconIElementOrIcon-Right icon of the tab
rightControlAriaLabelString-Right icon button aria-label
allowFocusTabPanelBooleantrueWhen true, the tabpanel has tabIndex 0 in order to allow focus on it
autoWidthBooleanfalseWhen true, tab width is auto, else "100%/numOptions"
maxTabsInViewNumber3When mobile, max Number of tabs to show
minTabsInViewNumber2When mobile, if the Number of options is equal to this value, show all tabs in the view
hideLabelForSingleTabBoolean2Boolean to hide label if it is a single tab
unMountContentBoolean2Boolean to hide unmount or not the content of tabs
dataTestIdStringprimaryTabTest id of the component
ctvTabsVariantStylesType-Modify styles for the default version of the component

Tabs Controlled

PropertyTypeDefaultDescription
variant
Required
String-Variant
selectedTabNumber0Default tab selected
tabsPrimaryTabTabType-List of tabs
contentReactNode-Content for each tab
onSelectTab(index: Number) => void-onSelectTab callback
leftIconIElementOrIcon-Left icon of the tab
leftControlAriaLabelString-Left icon button aria-label
rightIconIElementOrIcon-Right icon of the tab
rightControlAriaLabelString-Right icon button aria-label
allowFocusTabPanelBooleantrueWhen true, the tabpanel has tabIndex 0 in order to allow focus on it
autoWidthBooleanfalseWhen true, tab width is auto, else "100%/numOptions"
maxTabsInViewNumber3When mobile, max Number of tabs to show
minTabsInViewNumber2When mobile, if the Number of options is equal to this value, show all tabs in the view
hideLabelForSingleTabBoolean2Boolean to hide label if it is a single tab
unMountContentBoolean2Boolean to hide unmount or not the content of tabs
dataTestIdStringprimaryTabTest id of the component
ctvTabsVariantStylesType-Modify styles for the default version of the component