useTabs API
Demos
For examples and details on the usage of this React hook, visit the demo pages:
Import
import useTabs from '@mui/base/useTabs';Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| defaultValue | string | number | false | The default value. Use when the component is not controlled. | |
| direction | 'ltr' | 'rtl' | 'ltr' | The direction of the text. |
| onChange | (event: React.SyntheticEvent, value: number | string | boolean) => void | Callback invoked when new value is being set. | |
| orientation | 'horizontal' | 'vertical' | 'horizontal' | The component orientation (layout flow direction). |
| selectionFollowsFocus | boolean | If true the selected tab changes on focus. Otherwise it only
changes on activation. | |
| value | string | number | false | The value of the currently selected Tab.
If you don't want any selected Tab, you can set this prop to false. |
Return value
| Name | Type | Default | Description |
|---|---|---|---|
| tabsContextValue | TabsContextValue | Returns the values to be passed to the tabs context provider. |