Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 372 Bytes

File metadata and controls

27 lines (21 loc) · 372 Bytes

useCursorPosition

import { useCursorPosition } from '@ttrmz/react-utils'

Usage

const Example = () => {
  const { x, y } = useCursorPosition()

  return (
    <div>
      <span>x position : {x}</span>
      <span>y position : {y}</span>
    </div>
  )
}

Returned object

Key Type
x Number
y Number