Skip to content

useMouse ​

Category
Sensors

Hook that manages a mouse position

typescript
import { useMouse } from '@siberiacancode/reactuse';

Usage ​

typescript
const { x, y, elementX, elementY, elementPositionX, elementPositionY } = useMouse(target);

Demo ​

Api ​

Parameters

NameTypeDefaultNote
targetTarget-The target element to manage the mouse position for

Contributors ​

Source • Demo