UNPKG

@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.

22 lines 891 B
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 | undefined; /** * 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') | undefined; } /** * 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;