ES Drager provides built-in rotation functionality that can be enabled with a single prop.
Enable rotation by setting the rotatable
prop. A rotation handle will appear above the element:
Drag the rotation handle above the element to rotate it.
You can set an initial rotation angle using the rotation
prop (in degrees):
Track rotation changes using the onRotate
event handler:
Open your browser's console to see the rotation angle being logged.
Rotation works seamlessly with dragging and other features: