Demo

Cropper

A component to crop images with interactions.

Loading...

Usage

example-usage.tsx
const cropperRef = React.useRef<CropperElement>(null);

async function handleApply() {
  const croppedImage = await cropperRef.current?.getCroppedImage();
}

<Cropper
  ref={cropperRef}
  file={file}
  aspectRatio={1}
  circularCrop={true}
/>;