@base-ui/react
Version:
Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.
36 lines • 1.41 kB
TypeScript
import type { CompositeMetadata } from "../../internals/composite/list/CompositeList.js";
import type { TabsTab } from "../tab/TabsTab.js";
import type { TabsRoot } from "./TabsRoot.js";
export interface TabsRootContext {
/**
* The currently active tab's value.
*/
value: TabsTab.Value;
/**
* Callback for setting new value.
*/
onValueChange: (value: TabsTab.Value, eventDetails: TabsRoot.ChangeEventDetails) => void;
/**
* The component orientation (layout flow direction).
*/
orientation: 'horizontal' | 'vertical';
/**
* Gets the element of the Tab with the given value.
*/
getTabElementBySelectedValue: (selectedValue: TabsTab.Value) => HTMLElement | null;
/**
* Gets the `id` attribute of the Tab that corresponds to the given TabPanel value.
*/
getTabIdByPanelValue: (panelValue: TabsTab.Value) => string | undefined;
/**
* Gets the `id` attribute of the TabPanel that corresponds to the given Tab value.
*/
getTabPanelIdByValue: (tabValue: TabsTab.Value) => string | undefined;
registerMountedTabPanel: (panelValue: TabsTab.Value, panelId: string) => () => void;
setTabMap: (map: Map<Node, CompositeMetadata<TabsTab.Metadata>>) => void;
/**
* The position of the active tab relative to the previously active tab.
*/
tabActivationDirection: TabsTab.ActivationDirection;
}
export declare function useTabsRootContext(): TabsRootContext;