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.

Loading...

Motion Studio

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 330+ other examples.

Latest React examples

Motion is supported by the best in the industry.