Buy Pro
Docs
Cropper

Cropper

A component to crop images with interactions.

Usage

import { Cropper, type CropperElement } from '@/components/ui/cropper';
const cropperRef = React.useRef<CropperElement>(null);
 
async function handleApply() {
  const croppedImage = await cropperRef.current?.getCroppedImage();
}
 
<Cropper
  ref={cropperRef}
  file={file}
  aspectRatio={1}
  circularCrop={true}
/>;