materialuiupgraded
Version:
Material-UI's workspace package
80 lines (43 loc) • 2.54 kB
Markdown
---
title: Tabs React component
components: Tabs, Tab
---
<p class="description">Tabs make it easy to explore and switch between different views.</p>
[](https://material.io/design/components/tabs.html) organize and allow navigation between groups of content that are related and at the same level of hierarchy.
A simple example with no frills.
{{"demo": "pages/demos/tabs/SimpleTabs.js"}}
Long labels will automatically wrap on tabs. If the label is too long for the tab, it will overflow and the text will not be visible.
{{"demo": "pages/demos/tabs/TabsWrappedLabel.js"}}
A Tab can be disabled by setting `disabled` property.
{{"demo": "pages/demos/tabs/DisabledTabs.js"}}
Fixed tabs should be used with a limited number of tabs and when consistent placement will aid muscle memory.
The `fullWidth` property should be used for smaller views.
This demo also uses [react-swipeable-views](https://github.com/oliviertassinari/react-swipeable-views) to animate the Tab transition, and allowing tabs to be swiped on touch devices.
{{"demo": "pages/demos/tabs/FullWidthTabs.js"}}
The `centered` property should be used for larger views.
{{"demo": "pages/demos/tabs/CenteredTabs.js"}}
Left and right scroll buttons will automatically be presented on desktop and hidden on mobile. (based on viewport width)
{{"demo": "pages/demos/tabs/ScrollableTabsButtonAuto.js"}}
Left and right scroll buttons will be presented regardless of the viewport width.
{{"demo": "pages/demos/tabs/ScrollableTabsButtonForce.js"}}
Left and right scroll buttons will never be presented. All scrolling must be initiated through user agent scrolling mechanisms (e.g. left/right swipe, shift-mousewheel, etc.)
{{"demo": "pages/demos/tabs/ScrollableTabsButtonPrevent.js"}}
Tab labels may be either all icons or all text.
{{"demo": "pages/demos/tabs/IconTabs.js"}}
{{"demo": "pages/demos/tabs/IconLabelTabs.js"}}
If you have read the [overrides documentation page](/customization/overrides/)
but aren't confident jumping in, here's an example of how you can change the main color of the Tabs. The following demo matches the [Ant Design UI](https://ant.design/components/tabs/).
{{"demo": "pages/demos/tabs/CustomizedTabs.js"}}