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...

Related docs

Motion Studio

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

Motion is supported by the best in the industry.