Mouse Position | useWeb (original) (raw)
This API provides access to the x
and y
of the mouse cursor position.
# State
The useMousePosition
function exposes the following reactive state:
State | Type | Description |
---|---|---|
x | Number | The mouse cursor position along the x-axis. |
y | Number | The mouse cursor position along the y-axis. |
Note!
By default the updates the state are throttled by 100ms to keep things snappy but you can configure that.
# Config
useMousePosition
function takes an options object as an optional parameter.
# Example
# Demo
Credits: Codepen by Chuloo