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 examples
Latest in React
Motion+
Unlock all 370+ examples
- Source code for every Plus example.
- Provide examples direct to your agent via Motion's MCP.
- Lifetime access to new examples and APIs.
