Gesture and transition building blocks

All optional props without a default remain undefined. class accepts Svelte ClassValue; style is a CSS string.

These primitives require and provide no cropper context. Supply their data and callbacks explicitly. Unless listed, they have no exported instance methods. Container children are optional Snippet values rendered without arguments.

DraggableArea

Reports incremental movement in layout pixels and the original MouseEvent or TouchEvent. activationDistance is the touch movement threshold. onMoveStart/onMoveEnd bracket an active gesture; onEnter/onLeave report hover.

PropTypeDefault
classClassValueundefined
stylestringundefined
childrenSnippetundefined
disabledbooleanfalse
onMove(directions: MoveDirections, nativeEvent: MouseEvent | TouchEvent) => voidundefined
onMoveEnd() => voidundefined
onMoveStart() => voidundefined
onLeave() => voidundefined
onEnter() => voidundefined
useAnchorbooleantrue
activationDistancenumber30

Selectors are listed in the complete styling inventory.

TransformableImage

Converts mouse, touch and wheel events to ImageTransform values. onEvent can veto handling using TransformableImageEvent.preventDefault(). Gesture listeners are native and non-passive, installed through attachments.

PropTypeDefault
onTransform(transform: ImageTransform) => voidundefined
onTransformEnd() => voidundefined
onEvent(transformEvent: TransformableImageEvent, nativeEvent: Event) => unknownundefined
disabledbooleanundefined
touchMovebooleantrue
mouseMovebooleantrue
touchScalebooleantrue
touchRotatebooleanfalse
wheelScaleboolean | { ratio: number; }true (ratio 0.1)
timeoutnumber500 ms
childrenSnippetundefined
classClassValueundefined
stylestringundefined
preventDefaultbooleantrue

Selectors are listed in the complete styling inventory.

CropperFade

Applies a visible modifier when visible is truthy; children remain mounted.

PropTypeDefault
visibleunknownundefined
classClassValueundefined
stylestringundefined
childrenSnippetundefined

Selectors are listed in the complete styling inventory.

TransformableImageEvent

Constructed with { active: boolean }. Public fields are active: boolean and defaultPrevented: boolean (initially false). preventDefault(): void sets the latter to true, vetoing cropper handling. It does not itself call the native event’s preventDefault. onEvent also receives that native Event.

DraggableArea and TransformableImage account for ancestor scale transforms when converting pointer deltas. Rotated or skewed containers are not supported by that conversion.