useMouse

provides the x and y coords on the screen/page/client

Demo

Move your mouse around

Client X: 0px, Y: 0px

Mouse X: 0px, Y: 0px

Delta X: 0px, Y: 0px

Usage

const { 
const client: Signal<{
    x: number;
    y: number;
}>
client
,
const mouse: Signal<{
    x: number;
    y: number;
}>
mouse
,
const delta: Signal<{
    x: number;
    y: number;
}>
delta
} =
function useMouse(): {
    mouse: Signal<{
        x: number;
        y: number;
    }>;
    delta: Signal<{
        x: number;
        y: number;
    }>;
    client: Signal<{
        x: number;
        y: number;
    }>;
}
useMouse
()