Optional onThe originating pointer event.
A PanInfo object containing x and y values for:
point: Relative to the device or page.delta: Distance moved since the last event.offset: Offset from the original pan event.velocity: Current velocity of the pointer.Optional onCallback function that fires when the pan gesture ends on this element.
function onPanEnd(event, info) {
console.log(info.point.x, info.point.y)
}
<motion.div onPanEnd={onPanEnd} />
The originating pointer event.
A PanInfo object containing x/y values for:
point: Relative to the device or page.delta: Distance moved since the last event.offset: Offset from the original pan event.velocity: Current velocity of the pointer.Optional onCallback function that fires when we begin detecting a pan gesture. This
is analogous to onMouseStart or onTouchStart.
function onPanSessionStart(event, info) {
console.log(info.point.x, info.point.y)
}
<motion.div onPanSessionStart={onPanSessionStart} />
The originating pointer event.
An EventInfo object containing x/y values for:
point: Relative to the device or page.Optional onCallback function that fires when the pan gesture begins on this element.
function onPanStart(event, info) {
console.log(info.point.x, info.point.y)
}
<motion.div onPanStart={onPanStart} />
The originating pointer event.
A PanInfo object containing x/y values for:
point: Relative to the device or page.delta: Distance moved since the last event.offset: Offset from the original pan event.velocity: Current velocity of the pointer.Generated using TypeDoc
Callback function that fires when the pan gesture is recognised on this element.
Note: For pan gestures to work correctly with touch input, the element needs touch scrolling to be disabled on either x/y or both axis with the touch-action CSS rule.