@base-ui-components/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.
31 lines (30 loc) • 1.32 kB
TypeScript
import * as React from 'react';
import type { TabsRootContext } from '../root/TabsRootContext.js';
import { GenericHTMLProps } from '../../utils/types.js';
declare function useTabsList(parameters: useTabsList.Parameters): useTabsList.ReturnValue;
declare namespace useTabsList {
interface Parameters extends Pick<TabsRootContext, 'getTabElementBySelectedValue' | 'onValueChange' | 'orientation' | 'setTabMap' | 'value'> {
/**
* Ref to the root element.
*/
rootRef: React.Ref<Element>;
tabsListRef: React.RefObject<HTMLElement | null>;
}
interface ReturnValue {
/**
* Resolver for the TabsList component's props.
* @param externalProps additional props for Tabs.TabsList
* @returns props that should be spread on Tabs.TabsList
*/
getRootProps: (externalProps?: GenericHTMLProps) => GenericHTMLProps;
/**
* Callback when a Tab is activated
* @param {any | null} newValue The value of the newly activated tab.
* @param {Event} event The event that activated the Tab.
*/
onTabActivation: (newValue: any, event: Event) => void;
rootRef: React.RefCallback<Element> | null;
tabsListRef: React.RefObject<HTMLElement | null>;
}
}
export { useTabsList };