Get started with ES Drager in just a few minutes.
Import the Drager component and use it to wrap any content you want to make draggable:
import { Drager } from '@es-space/es-drager-react'
function App() {
return (
<Drager className="w-32 h-32 bg-blue-500">
Drag me!
</Drager>
)
}
Enable rotation and scaling with simple props:
<Drager
className="w-32 h-32 bg-blue-500"
rotatable
scalable
minScale={0.5}
maxScale={2}
>
Try all features!
</Drager>
Enable connection points to create node-based interfaces:
<Drager
id="node-1"
className="w-32 h-32 bg-blue-500"
connectable
onConnect={(sourceId, sourceAnchor, targetId, targetAnchor) => {
console.log('Connected:', { sourceId, sourceAnchor, targetId, targetAnchor })
}}
>
Node 1
</Drager>