Passed in to pan event handlers like onPan the PanInfo object contains information about the current state of the tap gesture such as its point, delta, offset and velocity.

<motion.div onPan={(event, info) => {
console.log(info.point.x, info.point.y)
}} />
interface PanInfo {
    delta: Point;
    offset: Point;
    point: Point;
    velocity: Point;
}

Properties

delta: Point

Contains x and y values for the distance moved since the last event.

function onPan(event, info) {
console.log(info.delta.x, info.delta.y)
}

<motion.div onPan={onPan} />
offset: Point

Contains x and y values for the distance moved from the first pan event.

function onPan(event, info) {
console.log(info.offset.x, info.offset.y)
}

<motion.div onPan={onPan} />
point: Point

Contains x and y values for the current pan position relative to the device or page.

function onPan(event, info) {
console.log(info.point.x, info.point.y)
}

<motion.div onPan={onPan} />
velocity: Point

Contains x and y values for the current velocity of the pointer, in px/ms.

function onPan(event, info) {
console.log(info.velocity.x, info.velocity.y)
}

<motion.div onPan={onPan} />

Generated using TypeDoc