Skip to main content

Events

All event callbacks share the same signature: (pos: PosData, event: MouseEvent) => void.

PropTrigger
onActivatedThe element is activated
onDragStart / onDragging / onDragStopDrag start / move / stop
onResizeStart / onResizing / onResizeStopResize start / move / stop
onRotateStart / onRotating / onRotateStopRotate start / move / stop
onFlipedA resize handle crosses the opposite edge and flips the rectangle
interface PosData {
uuid: string | number
x: number
y: number
w: number
h: number
r: number
z: number | string
stick: '' | 'tl' | 'tm' | 'tr' | 'mr' | 'br' | 'bm' | 'bl' | 'ml' | 'angle'
lock: boolean
active: boolean
flipSign: '' | '+' | '-'
}