Drag: Constraints
An example of making an element draggable using Motion for React's drag prop. You can even set drag constraints by providing a ref to another element.

An example of making an element draggable using Motion for React's drag prop. You can even set drag constraints by providing a ref to another element.
Use Motion Studio to create new components or infuse static designs with animations based on "Drag: Constraints" and 330+ other examples.

Motion is supported by the best in the industry.