Tabs
Tabs make it easy to explore and switch between different views.Basic Tabs
A simple example with text labels.Tabs with Icons
Add icons to tabs for better visual communication.Scrollable Tabs
For many tabs, use scrollable variant.Full Width Tabs
Make tabs fill available width.Centered Tabs
Center the tabs.Vertical Tabs
Display tabs vertically.Color
Customize indicator and text color.Disabled Tab
Disable individual tabs.Wrapped Labels
Long labels automatically wrap.Custom Tabs
UseselectionFollowsFocus for better keyboard navigation.
Props
value
- Type:
any - Description: The value of the currently selected Tab. If you don’t want any selected Tab, set this prop to
false
onChange
- Type:
(event: React.SyntheticEvent, value: any) => void - Description: Callback fired when the value changes. The second parameter is the new value
orientation
- Type:
'horizontal' | 'vertical' - Default:
'horizontal' - Description: The component orientation (layout flow direction)
variant
- Type:
'standard' | 'scrollable' | 'fullWidth' - Default:
'standard' - Description: Determines additional display behavior of the tabs
- scrollable: Allows horizontal scrolling
- fullWidth: Tabs grow to use all available space
- standard: Default state
indicatorColor
- Type:
'primary' | 'secondary' - Default:
'primary' - Description: Determines the color of the indicator
textColor
- Type:
'primary' | 'secondary' | 'inherit' - Default:
'primary' - Description: Determines the color of the Tab text
scrollButtons
- Type:
'auto' | true | false - Default:
'auto' - Description: Determine behavior of scroll buttons when tabs are set to scroll
- auto: Only present when not all items are visible
- true: Always present
- false: Never present
allowScrollButtonsMobile
- Type:
boolean - Default:
false - Description: If
true, the scroll buttons aren’t forced hidden on mobile
centered
- Type:
boolean - Default:
false - Description: If
true, the tabs are centered. This prop is intended for large views
selectionFollowsFocus
- Type:
boolean - Description: If
true, the selected tab changes on focus. Otherwise it only changes on activation
visibleScrollbar
- Type:
boolean - Default:
false - Description: If
true, the scrollbar is visible. Useful when displaying a long vertical list of tabs
slots
- Type:
{ root?: React.ElementType, scroller?: React.ElementType, list?: React.ElementType, scrollbar?: React.ElementType, indicator?: React.ElementType, scrollButtons?: React.ElementType, startScrollButtonIcon?: React.ElementType, endScrollButtonIcon?: React.ElementType } - Description: The components used for each slot inside the tabs
slotProps
- Type:
{ root?: object, scroller?: object, list?: object, scrollbar?: object, indicator?: object, scrollButtons?: object, startScrollButtonIcon?: object, endScrollButtonIcon?: object } - Description: The props used for each slot inside the tabs
sx
- Type:
SxProps<Theme> - Description: System prop for defining CSS styles
Accessibility
- Use
aria-labeloraria-labelledbyon the Tabs component - Each Tab panel should have
role="tabpanel"and be linked viaaria-labelledbyto its Tab - Tab navigation with arrow keys is automatically handled
- Home/End keys jump to first/last tab
- When a Tab is focused, pressing Space or Enter activates it