UNPKG

1.15 kBTypeScriptView Raw
1/// <reference types="react" />
2export interface UseTabPanelParameters {
3 /**
4 * The id of the TabPanel.
5 */
6 id?: string;
7 /**
8 * The ref of the TabPanel.
9 */
10 rootRef?: React.Ref<HTMLElement>;
11 /**
12 * The value of the TabPanel. It will be shown when the Tab with the corresponding value is selected.
13 */
14 value?: number | string;
15}
16interface UseTabPanelRootSlotOwnProps {
17 'aria-labelledby'?: string;
18 hidden?: boolean;
19 id?: string;
20 ref: React.Ref<HTMLElement>;
21}
22export type UseTabPanelRootSlotProps<ExternalProps = {}> = ExternalProps & UseTabPanelRootSlotOwnProps;
23export interface UseTabPanelReturnValue {
24 /**
25 * If `true`, it indicates that the tab panel will be hidden.
26 */
27 hidden: boolean;
28 /**
29 * Resolver for the root slot's props.
30 * @param externalProps additional props for the root slot
31 * @returns props that should be spread on the root slot
32 */
33 getRootProps: <ExternalProps extends Record<string, unknown> = {}>(externalProps?: ExternalProps) => UseTabPanelRootSlotProps<ExternalProps>;
34 rootRef: React.Ref<HTMLElement>;
35}
36export {};