Drag
drag opts a motion element into pointer-based dragging. Pass true, 'x', or 'y' and motion
tracks pointer movement, then applies inertia on release.
<motion.div drag />
Constraints
Constrain with a box, an element ref, or both:
<motion.div drag dragConstraints={{ left: 0, right: 200, top: 0, bottom: 80 }} />
Snap & momentum
dragSnapToOrigin returns the element to its start point after release. dragMomentum controls
post-flick decay, and dragElastic controls how far the element can stretch past its constraints.
Reorder a list
<Reorder> builds on drag to provide sortable lists with layout animations.
- Rose⇅
- Violet⇅
- Mint⇅
- Amber⇅
See also
createDragControls- start a drag from a separate handle