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) => void
Return value
If true
, the tab has visible focus.
This is a workaround for browsers that do not support this feature natively.
Type:
boolean
Resolver 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:
boolean
useTabs 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) => void
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:
boolean
Return 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:
TabsListProviderValue
Action dispatcher for the tabs list component. Allows to programmatically control the tabs list.
Type:
(action: ListAction<string | number>) => void
Resolver for the root slot's props.
Type:
<TOther extends Record<string, any> = {}>(externalProps?: TOther) => UseTabsListRootSlotProps<TOther>