Tabs
Tabs are UI elements for organizing and navigating between groups of related content.
Tab API
Import
import Tab from '@mui/base/Tab';
// or
import { Tab } from '@mui/base';
Props
Props of the native component are also available.
A ref for imperative actions. It currently only supports focusVisible()
action.
Type:
func | { current?: { focusVisible: func } }
The components used for each slot inside the Tab. Either a string to use a HTML element or a component.
Type:
{ root?: elementType }
Default:
{}
The
ref
is forwarded to the root element.Slots
To learn how to customize the slot, check out the Overriding component structure guide.
You can override the style of the component using one of these customization options:
- With a global class name.
- With a rule name as part of the component's
styleOverrides
property in a custom theme.
CSS classes
These class names are useful for styling with CSS. They are applied to the root slot when specific states are triggered.
TabPanel API
Import
import TabPanel from '@mui/base/TabPanel';
// or
import { TabPanel } from '@mui/base';
Props
Props of the native component are also available.
The components used for each slot inside the TabPanel. Either a string to use a HTML element or a component.
Type:
{ root?: elementType }
Default:
{}
The
ref
is forwarded to the root element.Slots
To learn how to customize the slot, check out the Overriding component structure guide.
You can override the style of the component using one of these customization options:
- With a global class name.
- With a rule name as part of the component's
styleOverrides
property in a custom theme.
CSS classes
These class names are useful for styling with CSS. They are applied to the root slot when specific states are triggered.
State class applied to the root div
element if hidden={true}
.
Tabs API
Import
import Tabs from '@mui/base/Tabs';
// or
import { Tabs } from '@mui/base';
Props
Props of the native component are also available.
The component orientation (layout flow direction).
Type:
'horizontal' | 'vertical'
Default:
'horizontal'
If true
the selected tab changes on focus. Otherwise it only changes on activation.
Type:
bool
The components used for each slot inside the Tabs. Either a string to use a HTML element or a component.
Type:
{ root?: elementType }
Default:
{}
The
ref
is forwarded to the root element.Slots
To learn how to customize the slot, check out the Overriding component structure guide.
You can override the style of the component using one of these customization options:
- With a global class name.
- With a rule name as part of the component's
styleOverrides
property in a custom theme.
CSS classes
These class names are useful for styling with CSS. They are applied to the root slot when specific states are triggered.
TabsList API
Import
import TabsList from '@mui/base/TabsList';
// or
import { TabsList } from '@mui/base';
Props
Props of the native component are also available.
The
ref
is forwarded to the root element.Slots
To learn how to customize the slot, check out the Overriding component structure guide.
You can override the style of the component using one of these customization options:
- With a global class name.
- With a rule name as part of the component's
styleOverrides
property in a custom theme.
CSS classes
These class names are useful for styling with CSS. They are applied to the root slot when specific states are triggered.