Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

get-client-xy

Richienb2.7kMIT2.0.0TypeScript support: included

Get coordinates from a mouse or touch event.

event, clientRect, touch, mousedown, mouse, mouseevent, getBoundingClientRect

readme

get-client-xy

Get coordinates from a mouse or touch event.

NPM Badge

Install

npm install get-client-xy

Usage

const getClientXY = require("get-client-xy")

const [x, y] = getClientXY(event)

API

getClientXY(event)

event

Type: MouseEvent | TouchEvent

The event to extract the data from.