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.
Related docs
Enhance your AI code editor with this example
Use Motion Studio to create new components or infuse static designs with animations based on "Drag: Constraints" and 300+ other examples.




