Tabs
Tabs are UI elements for organizing and navigating between groups of related content.
useTab API
Import
import { useTab } from '@mui/base/useTab';
// or
import { useTab } from '@mui/base';Parameters
If true, the tab will be disabled.
Type:
(event: React.SyntheticEvent, value: number | string) => voidReturn value
If true, the tab has visible focus.
This is a workaround for browsers that do not support this feature natively.
Type:
booleanResolver for the root slot's props.
Type:
<TOther extends Record<string, any> = {}>(externalProps?: TOther) => UseTabRootSlotProps<TOther>Sets the focus-visible state of the tab. This is a workaround for browsers that do not support this feature natively.
Type:
React.Dispatch<React.SetStateAction<boolean>>useTabPanel API
Import
import { useTabPanel } from '@mui/base/useTabPanel';
// or
import { useTabPanel } from '@mui/base';Parameters
Return value
If true, it indicates that the tab panel will be hidden.
Type:
booleanuseTabs API
Import
import { useTabs } from '@mui/base/useTabs';
// or
import { useTabs } from '@mui/base';Parameters
Callback invoked when new value is being set.
Type:
(event: React.SyntheticEvent | null, value: number | string | null) => voidThe 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:
booleanReturn value
useTabsList API
Import
import { useTabsList } from '@mui/base/useTabsList';
// or
import { useTabsList } from '@mui/base';Parameters
Return value
The value to be passed to the TabListProvider above all the tabs.
Type:
TabsListProviderValueAction dispatcher for the tabs list component. Allows to programmatically control the tabs list.
Type:
(action: ListAction<string | number>) => voidResolver for the root slot's props.
Type:
<TOther extends Record<string, any> = {}>(externalProps?: TOther) => UseTabsListRootSlotProps<TOther>