Tabs API
The API documentation of the Tabs React component. Learn more about the props and the CSS customization points.
Import
import Tabs from '@material-ui/core/Tabs';
// or
import { Tabs } from '@material-ui/core';You can learn more about the difference by reading this guide.
Component name
The MuiTabs name can be used for providing default props or style overrides at the theme level.
Props
| Name | Type | Default | Description | 
|---|---|---|---|
| action | ref | Callback fired when the component mounts. This is useful when you want to trigger an action programmatically. It supports two actions: updateIndicator()andupdateScrollButtons() | |
| aria-label | string | The label for the Tabs as a string. | |
| aria-labelledby | string | An id or list of ids separated by a space that label the Tabs. | |
| centered | bool | false | If true, the tabs will be centered. This property is intended for large views. | 
| children | node | The content of the component. | |
| classes | object | Override or extend the styles applied to the component. See CSS API below for more details. | |
| component | elementType | 'div' | The component used for the root node. Either a string to use a HTML element or a component. | 
| indicatorColor | 'secondary' | 'primary' | 'secondary' | Determines the color of the indicator. | 
| onChange | func | Callback fired when the value changes. Signature: function(event: object, value: any) => voidevent: The event source of the callback value: We default to the index of the child (number) | |
| orientation | 'horizontal' | 'vertical' | 'horizontal' | The tabs orientation (layout flow direction). | 
| ScrollButtonComponent | elementType | TabScrollButton | The component used to render the scroll buttons. | 
| scrollButtons | 'auto' | 'desktop' | 'on' | 'off' | 'auto' | Determine behavior of scroll buttons when tabs are set to scroll: - autowill only present them when not all the items are visible. -desktopwill only present them on medium and larger viewports. -onwill always present them. -offwill never present them. | 
| selectionFollowsFocus | bool | If truethe selected tab changes on focus. Otherwise it only changes on activation. | |
| TabIndicatorProps | object | {} | Props applied to the tab indicator element. | 
| TabScrollButtonProps | object | Props applied to the TabScrollButtonelement. | |
| textColor | 'secondary' | 'primary' | 'inherit' | 'inherit' | Determines the color of the Tab. | 
| value | any | The value of the currently selected Tab. If you don't want any selectedTab, you can set this property tofalse. | |
| variant | 'standard' | 'scrollable' | 'fullWidth' | 'standard' | Determines additional display behavior of the tabs: - scrollablewill invoke scrolling properties and allow for horizontally  scrolling (or swiping) of the tab bar.  -fullWidthwill make the tabs grow to use all the available space,  which should be used for small views, like on mobile.  -standardwill render the default state. | 
The ref is forwarded to the root element.
Any other props supplied will be provided to the root element (native element).
CSS
| Rule name | Global class | Description | 
|---|---|---|
| root | .MuiTabs-root | Styles applied to the root element. | 
| vertical | .MuiTabs-vertical | Styles applied to the root element if orientation="vertical". | 
| flexContainer | .MuiTabs-flexContainer | Styles applied to the flex container element. | 
| flexContainerVertical | .MuiTabs-flexContainerVertical | Styles applied to the flex container element if orientation="vertical". | 
| centered | .MuiTabs-centered | Styles applied to the flex container element if centered={true}&!variant="scrollable". | 
| scroller | .MuiTabs-scroller | Styles applied to the tablist element. | 
| fixed | .MuiTabs-fixed | Styles applied to the tablist element if !variant="scrollable". | 
| scrollable | .MuiTabs-scrollable | Styles applied to the tablist element if variant="scrollable". | 
| scrollButtons | .MuiTabs-scrollButtons | Styles applied to the ScrollButtonComponentcomponent. | 
| scrollButtonsDesktop | .MuiTabs-scrollButtonsDesktop | Styles applied to the ScrollButtonComponentcomponent ifscrollButtons="auto"or scrollButtons="desktop"`. | 
| indicator | .MuiTabs-indicator | Styles applied to the TabIndicatorcomponent. | 
You can override the style of the component thanks to one of these customization points:
- With a rule name of the classesobject prop.
- With a global class name.
- With a theme and an overridesproperty.
If that's not sufficient, you can check the implementation of the component for more detail.