@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.
20 lines • 1.01 kB
TypeScript
import * as React from 'react';
import type { ElementProps } from "../types.js";
import { ACTIVE_KEY, SELECTED_KEY } from "../utils/constants.js";
export type ExtendedUserProps = {
[ACTIVE_KEY]?: boolean;
[SELECTED_KEY]?: boolean;
};
export interface UseInteractionsReturn {
getReferenceProps: (userProps?: React.HTMLProps<Element>) => Record<string, unknown>;
getFloatingProps: (userProps?: React.HTMLProps<HTMLElement>) => Record<string, unknown>;
getItemProps: (userProps?: Omit<React.HTMLProps<HTMLElement>, 'selected' | 'active'> & ExtendedUserProps) => Record<string, unknown>;
getTriggerProps: (userProps?: React.HTMLProps<Element>) => Record<string, unknown>;
}
/**
* Merges an array of interaction hooks' props into prop getters, allowing
* event handler functions to be composed together without overwriting one
* another.
* @see https://floating-ui.com/docs/useInteractions
*/
export declare function useInteractions(propsList?: Array<ElementProps | void>): UseInteractionsReturn;