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';
If true
, the tab will be disabled.
Type:(event: React.SyntheticEvent, value: number | string) => void
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:<ExternalProps extends Record<string, unknown> = {}>(externalProps?: ExternalProps) => UseTabRootSlotProps<ExternalProps>
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';
Resolver for the root slot's props.
Type:<ExternalProps extends Record<string, unknown> = {}>(externalProps?: ExternalProps) => UseTabPanelRootSlotProps<ExternalProps>
useTabs API
Import
import { useTabs } from '@mui/base/useTabs';
// or
import { useTabs } from '@mui/base';
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
useTabsList API
Import
import { useTabsList } from '@mui/base/useTabsList';
// or
import { useTabsList } from '@mui/base';
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:<ExternalProps extends Record<string, unknown> = {}>(externalProps?: ExternalProps) => UseTabsListRootSlotProps<ExternalProps>