--- category: Sensors --- # usePointer Reactive [pointer state](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events). ## Basic Usage ```ts import { usePointer } from '@vueuse/core'; const { x, y, pressure, pointerType } = usePointer(); ``` ## Component Usage By default, the component will track the pointer on `window` ```vue ``` To track local position in the element, set `target="self"`: ```vue ``` ## Type Declarations ```ts export interface UsePointerState extends Position { pressure: number; pointerId: number; tiltX: number; tiltY: number; width: number; height: number; twist: number; pointerType: PointerType | null; } export interface UsePointerOptions extends ConfigurableWindow { /** * Pointer types that listen to. * * @default ['mouse', 'touch', 'pen'] */ pointerTypes?: PointerType[]; /** * Initial values */ initialValue?: MaybeRef>; /** * @default window */ target?: MaybeRef | Document | Window; } /** * Reactive pointer state. * * @see https://vueuse.org/usePointer * @param options */ export declare function usePointer(options?: UsePointerOptions): { isInside: ShallowRef; pressure: Ref; pointerId: Ref; tiltX: Ref; tiltY: Ref; width: Ref; height: Ref; twist: Ref; pointerType: Ref; x: Ref; y: Ref; }; export type UsePointerReturn = ReturnType; ```