use-mouse-location
v0.0.8
Published
react custom hook to get the cursor coordinates
Downloads
15
Maintainers
Readme
useMouseLocation Hook
Description
This is a simple react hook that returns the cursor coordinates.
How to install
npm i use-mouse-location
yarn add use-mouse-location
pnpm add use-mouse-location
bun add use-mouse-location
Quickstart
import { useMouseLocation } from 'use-mouse-location'
function App() {
const { x, y } = useMouseLocation();
return (
<div>
{x + ' ' + y}
</div>
)
}
export default App