Back to Popmotion

Events: Drag with boundaries

packages/popmotion-pose/docs/examples/react/event-drag-boundaries.md

8.7.1347 B
Original Source

Events: Drag with boundaries

Boundaries can be imposed on dragging by using the dragBounds property.

It accepts top, left, right, and bottom properties in either pixels or percentages.

javascript
const config = {
  draggable: 'x',
  dragBounds: { left: '-100%', right: '100%' }
}
<CodeSandbox height="500" id="j27p9l3v6y" />