ef-transform-handles

Resize and drag handles for a selected canvas element.

Renders an outlined bounding box with corner/edge resize handles and an optional rotation handle, positioned at bounds. Fires bounds-change on every drag or resize move. pointer-events: none on the host — only the handles themselves capture input.

Consumes panZoomTransformContext to correctly map pointer coordinates when the canvas is panned or zoomed.

Interactive example

Typical usage inside an ef-overlay-layer:

html
<ef-overlay-layer>
  <ef-overlay-item element-id="my-text">
    <ef-transform-handles
      enable-rotation
      enable-resize
      canvas-scale="1"
    ></ef-transform-handles>
  </ef-overlay-item>
</ef-overlay-layer>

Interaction modifiers:

css
ef-transform-handles::part(handle)    { background: #e94560; }
ef-transform-handles::part(handle-se) { background: #22c55e; }

Attributes

8 of 8

canvas-scale

React prop
canvasScale
Type
number
Default
1
Description
Current canvas zoom scale, used to keep handle hit areas a consistent screen size.

corners-only

React prop
cornersOnly
Type
boolean
Default
false
Description
Only shows corner resize handles, hiding edge handles.

enable-drag

React prop
enableDrag
Type
boolean
Default
true
Description
Allows dragging the selection by its body.

enable-resize

React prop
enableResize
Type
boolean
Default
true
Description
Shows resize handles.

enable-rotation

React prop
enableRotation
Type
boolean
Default
false
Description
Shows a rotation handle.

lock-aspect-ratio

React prop
lockAspectRatio
Type
boolean
Default
false
Description
Constrains resizing to the original aspect ratio.

min-size

React prop
minSize
Type
number
Default
—
Description
Minimum width/height in pixels during resize.

rotation-step

React prop
rotationStep
Type
number
Default
—
Description
Snap increment in degrees while rotating.

CSS Parts

CSS Custom Properties

Events