@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.
32 lines • 1.07 kB
TypeScript
import type { ElementProps, FloatingContext, FloatingRootContext } from "../types.js";
export interface UseClientPointProps {
/**
* Whether the Hook is enabled, including all internal Effects and event
* handlers.
* @default true
*/
enabled?: boolean;
/**
* Whether to restrict the client point to an axis and use the reference
* element (if it exists) as the other axis. This can be useful if the
* floating element is also interactive.
* @default 'both'
*/
axis?: 'x' | 'y' | 'both';
/**
* An explicitly defined `x` client coordinate.
* @default null
*/
x?: number | null;
/**
* An explicitly defined `y` client coordinate.
* @default null
*/
y?: number | null;
}
/**
* Positions the floating element relative to a client point (in the viewport),
* such as the mouse position. By default, it follows the mouse cursor.
* @see https://floating-ui.com/docs/useClientPoint
*/
export declare function useClientPoint(context: FloatingRootContext | FloatingContext, props?: UseClientPointProps): ElementProps;