Founding price: $35, then $79.99 after 23:59 UTC on 4 November, then $79.99
Get ProCrop, zoom and rotate an image with Cropper.js 2: aspect-ratio choices, a round avatar mask, keyboard and button controls for every move, a live size readout and a Blob result at the size you choose.
This item has no props to tune. Use the lens above to change theme, density, direction and more.
Cropper.js is imported when the component mounts (await import("cropperjs")), so it stays out of your initial bundle and the component is safe to render on the server. An image from another origin needs CORS headers (Access-Control-Allow-Origin), or the browser blocks reading its pixels.
| Prop | Type | Default | Description |
|---|---|---|---|
src | string | - | Image URL or object URL. |
aspectRatio | number | null | null | Start ratio (width over height). |
aspectOptions | { label, value }[] | Free, 1:1, 4:3, 16:9 | The ratio buttons. |
round | boolean | false | Circle mask, 1:1. |
maxOutputWidth | number | native | Output width cap in px. |
outputType, quality | image/png, image/jpeg, image/webp; number | image/png, 0.92 | Encoding. |
height | number | 320 | Height of the editing area. |
onCrop | ({ blob, url, width, height }) => void | - | Called with the result. |
onCancel, cropLabel | Optional Cancel button and the Crop button text. |
+ and - resize it (Cropper.js keyboard mode, switched on at focus and off at blur so it never captures keys elsewhere on the page).role="alert" message. Offer a way to skip cropping in your flow for anyone who cannot use the tool.The component ships with a Testing Library test (image-cropper.test.tsx) that covers: its main behaviour, the keyboard path and the error or empty states.