Tabs

size
disabled
import {TabProvider, TabList, Tab, TabPanel} from '@gravity-ui/uikit';

Tabs components is used to explore, organize content and switch between different views.

First Panel
Second Panel
Third Panel

Components

TabProvider

A component that provides the tab selection functionality

Properties

NameDescriptionTypeDefault
childrenList of tabs and tab panels, probably with some wrappersReact.ReactNode
valueActive tab valuestring
onUpdateUpdate tab handler(value: string) => void

TabList

Component that serves as the container for a set of tabs

Size

To control the size of the tabs use the size property. Default size is m.

Properties

TabList accepts any valid div element props in addition to these:

NameDescriptionTypeDefault
childrenList of tabs, probably with some wrappersReact.ReactNode
valueActive tab valuestring
onUpdateUpdate tab handler(value: string) => void
classNameCSS-class of elementstring
activateOnFocusActivate tab on focus. Use this only if panel's content can be displayed immediatelybooleanfalse
sizeElement size"m" "l" "xl""m"
qaHTML data-qa attribute, used in testsstring

Tab

This component is used to render tab items.

Icon

Used if you need to display an icon for a tab item.

States

Tab item has disabled flag.

Counter

Used if you need to display a number for a tabs item.

Label

Used if you need to display a label for a tabs item.

Properties

Tab accepts any valid button or a element props in addition to these:

NameDescriptionTypeDefault
valueTab valuestring
titleTab titlestring
iconIcon displayed at the startReact.ReactNode
counterContent displayed at the endnumber string
hrefA URL to link to.string
label<Label> displayed at the endReact.ReactNode
disabledInactive stateboolean
componentOverrides the root componentReact.ElementType
childrenTab's contentReact.ReactNode
qaHTML data-qa attribute, used in testsstring

TabPanel

Is a container element for content associated with a tab

Properties

TabPanel accepts any valid div element props in addition to these:

NameDescriptionTypeDefault
childrenContent of panelReact.ReactNode
valueActive tab valuestring
qaHTML data-qa attribute, used in testsstring

CSS API

NameDescription
--g-tabs-border-widthTabs border width
--g-tabs-item-heightTabs item height
--g-tabs-item-border-widthTabs item border width
--g-tabs-item-gapDistance between tabs
--g-tabs-vertical-item-heightTabs vertical item height
--g-tabs-vertical-item-paddingTabs vertical item padding