File: usemove.md | Updated: 11/15/2025
Introducing PrimeReact v11 Alpha 🥁Learn More
SearchK
10.9.7
HOOK
API
Handles move interactions via touch and mouse events.
Import#
import { useMove } from 'primereact/hooks';
Copy
Basic#
Drag the marker over the element to track the position.
X: 20Y: 60
Reset
const { ref, x, y, active, reset } = useMove({ initialValue: { x: 0.2, y: 0.6 } });
Copy
Horizontal#
A horizontal slider implementation by utilizing the x-axis only.
Value: 20
const { ref, x } = useMove({ initialValue: { x: 0.2 } });
Copy
Vertical#
A vertical slider implementation by utilizing the y-axis only.
Value: 20
const { ref, y } = useMove({ initialValue: { y: 0.2 } });
Copy
Import
Basic
Horizontal
Vertical
PrimeReact 10.9.7 by PrimeTek