react-advanced-cropper vs react-easy-crop vs react-image-crop
Implementing Image Cropping in React Applications
react-advanced-cropperreact-easy-cropreact-image-cropSimilar Packages:

Implementing Image Cropping in React Applications

react-advanced-cropper, react-easy-crop, and react-image-crop are React libraries designed to handle image selection, manipulation, and cropping within web applications. Each provides a component to render an image with an interactive overlay, allowing users to adjust the visible area before exporting the result. While they share the same core goal, they differ significantly in how they manage state, handle touch interactions, and allow UI customization. react-image-crop is a lightweight, established choice for standard cropping. react-easy-crop focuses on mobile-friendly interactions with built-in zoom and rotate support. react-advanced-cropper offers deep customization through a stencil system for complex interface requirements.

Npm Package Weekly Downloads Trend

3 Years

Github Stars Ranking

Stat Detail

Package
Downloads
Stars
Size
Issues
Publish
License
react-advanced-cropper08841.13 MB15a year agoMIT
react-easy-crop02,772281 kB6a month agoMIT
react-image-crop04,104115 kB732 months agoISC

React Image Croppers: Architecture and API Compared

react-advanced-cropper, react-easy-crop, and react-image-crop all solve the same problem β€” letting users select a portion of an image β€” but they handle state, touch input, and customization differently. Understanding these differences helps you pick the right tool for your project without over-engineering or hitting limitations later.

🧠 State Management: Manual vs Integrated

How each library tracks the crop area affects how you write your components.

react-image-crop keeps state entirely in your hands. You pass a crop object and update it via callbacks. This gives you full visibility but requires more boilerplate.

// react-image-crop: Manual state management
const [crop, setCrop] = useState({ unit: '%', width: 50, height: 50 });

<ReactCrop 
  src={imageSrc} 
  crop={crop} 
  onChange={setCrop} 
/>

react-easy-crop separates position (crop) and scale (zoom). You manage both, but the library handles the math for keeping them in bounds.

// react-easy-crop: Separated crop and zoom state
const [crop, setCrop] = useState({ x: 0, y: 0 });
const [zoom, setZoom] = useState(1);

<Cropper 
  image={imageSrc} 
  crop={crop} 
  zoom={zoom} 
  onCropChange={setCrop} 
  onZoomChange={setZoom} 
/>

react-advanced-cropper uses a single state object that includes coordinates, size, and canvas info. It simplifies updates by bundling related data.

// react-advanced-cropper: Unified state object
const [state, setState] = useState(null);

<Cropper 
  src={imageSrc} 
  onChange={setState} 
  stencilProps={{ aspectRatio: 1 }} 
/>

πŸ“± Touch & Zoom: Built-in vs Custom

Mobile support is often the deciding factor for user-facing apps.

react-image-crop supports touch but requires extra work for zooming. You typically need to wrap it or add logic to handle pinch gestures manually.

// react-image-crop: Basic touch support
// Zooming requires custom implementation or wrapper
<ReactCrop 
  src={imageSrc} 
  crop={crop} 
  onChange={setCrop} 
  // No built-in zoom prop
/>

react-easy-crop has zoom and rotation built into the core component. It works smoothly on mobile devices out of the box.

// react-easy-crop: Built-in zoom and rotation
<Cropper 
  image={imageSrc} 
  crop={crop} 
  zoom={zoom} 
  rotation={rotation} 
  onCropChange={setCrop} 
/>

react-advanced-cropper supports touch and zoom through its transformer system. You can enable it via props, but it may require configuration for specific gestures.

// react-advanced-cropper: Configurable touch support
<Cropper 
  src={imageSrc} 
  onChange={setState} 
  transformers={[transformers.touch, transformers.zoom]} 
/>

🎨 UI Control: Fixed vs Custom Stencils

The look of the cropping overlay matters for brand consistency.

react-image-crop uses a standard rectangular overlay. Customizing the look requires CSS overrides, which can be fragile across versions.

// react-image-crop: CSS overrides for UI
<ReactCrop 
  src={imageSrc} 
  crop={crop} 
  className="my-custom-crop-style" 
/>

react-easy-crop also uses a standard overlay. It focuses on function over form, so deep UI changes are limited without forked code.

// react-easy-crop: Limited UI customization
<Cropper 
  image={imageSrc} 
  crop={crop} 
  // No direct stencil prop for custom shapes
/>

react-advanced-cropper lets you swap the stencil component entirely. You can build circular, polygon, or branded overlays easily.

// react-advanced-cropper: Custom stencil component
<Cropper 
  src={imageSrc} 
  stencilProps={{ component: MyCustomStencil }} 
  onChange={setState} 
/>

πŸ’Ύ Exporting Results: Canvas vs Helpers

Getting the final image file is the last step in the flow.

react-image-crop provides helper functions like canvasPreview and canvasToBlob. You must call these manually after cropping.

// react-image-crop: Manual export helpers
const canvas = await canvasPreview(imageRef, crop, rotate);
const blob = await canvasToBlob(canvas);

react-easy-crop relies on external utilities often shown in docs, like getCroppedImg. You manage the canvas creation logic based on crop values.

// react-easy-crop: Utility based export
const croppedImage = await getCroppedImg(imageSrc, crop, rotation);

react-advanced-cropper includes methods on the component reference to get the canvas or blob directly. This reduces boilerplate code.

// react-advanced-cropper: Built-in export methods
const canvas = cropperRef.current.getCanvas();
const blob = await cropperRef.current.getBlob();

πŸ“Š Summary Table

Featurereact-image-cropreact-easy-cropreact-advanced-cropper
State ModelManual crop objectSeparate crop + zoomUnified state object
Mobile TouchBasic (Zoom needs work)Excellent (Built-in)Configurable (Transformers)
UI CustomizationCSS OverridesLimitedFull (Custom Stencils)
Export LogicHelper FunctionsExternal UtilitiesBuilt-in Methods
Best ForStandard rectangular cropsMobile profile uploadsCustom branded interfaces

πŸ’‘ The Big Picture

react-image-crop is the reliable workhorse 🐴 β€” perfect for admin panels or internal tools where standard rectangular cropping is enough and you want minimal dependencies.

react-easy-crop is the mobile specialist πŸ“± β€” ideal for consumer apps where users upload photos from phones and expect smooth pinch-to-zoom and rotate gestures.

react-advanced-cropper is the custom builder πŸ› οΈ β€” best for design-heavy products where the cropping tool must match a unique interface or support non-standard shapes like circles or polygons.

Final Thought: All three libraries are actively maintained and capable. Your choice should depend on whether you prioritize mobile gestures, UI flexibility, or simple integration.

How to Choose: react-advanced-cropper vs react-easy-crop vs react-image-crop

  • react-advanced-cropper:

    Choose react-advanced-cropper if you need full control over the cropping interface, such as custom shapes, complex constraints, or a unique design system. It is ideal for applications where the cropping UI must match a specific brand look or require non-standard interaction patterns like circular stencils with custom handles.

  • react-easy-crop:

    Choose react-easy-crop if your primary concern is mobile usability and you need built-in support for zooming and rotating images. It is the best fit for user-generated content flows, like profile picture uploads, where touch gestures must work smoothly without extra configuration.

  • react-image-crop:

    Choose react-image-crop if you want a lightweight, stable solution for standard rectangular cropping with minimal dependencies. It suits projects that need a reliable, no-frills implementation where developers prefer to manage the canvas export logic themselves for maximum control over the output.

README for react-advanced-cropper

React Advanced Cropper logo

Downloads Version
Documentation / Examples / Sandbox


:warning: It's the beta version. The API can be changed in the future. Therefore, it's recommended to fix the version with ~.


React Advanced Cropper is the advanced library that gives you opportunity to create your own croppers suited for any website design. It means that you are able to change not only the cropper appearance, you area able to customize its behavior also.

Features:

  • full mobile / desktop support
  • support all three main types of croppers right out of the box
  • support both canvas and coordinates modes, minimum and maximum aspect ratios, custom size restrictions
  • zoom, rotate, resize image
  • auto-zoom, transitions

Install

npm install --save react-advanced-cropper
yarn add react-advanced-cropper

Usage

import React, { useState } from 'react';
import { CropperRef, Cropper } from 'react-advanced-cropper';
import 'react-advanced-cropper/dist/style.css'

export const GettingStartedExample = () => {
	const [image, setImage] = useState(
		'https://images.unsplash.com/photo-1599140849279-1014532882fe?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1300&q=80',
	);

	const onChange = (cropper: CropperRef) => {
		console.log(cropper.getCoordinates(), cropper.getCanvas());
	};

	return (
		<Cropper
			src={image}
			onChange={onChange}
			className={'cropper'}
		/>
	)
};
/*
  Maybe you need to set the limits for the cropper sizes or its container sizes
  otherwise a cropping image will try to fill all available space
*/
.cropper {
  height: 600px;
  background: #DDD;
}

Cropper

PropTypeDescriptionDefault
srcstringThe cropping image (link / base64)
stencilComponentComponentThe stencil componentRectangleStencil
stencilPropsobjectThe props for the stencil component{}
classNamestringThe optional class for the root cropper block
imageClassNamestringThe optional class for the cropping image
boundariesClassNamestringThe optional class for the area.
backgroundClassNamestringThe optional class for the background under the image
autoZoombooleanEnable / disable transitionstrue
transitionsboolean, objectEnable / disable auto zoomfalse
stencilSizeobject The size of the stencil in pixels
canvasbooleanThe flag that indicates if canvas should be usedtrue
minWidthnumberThe minimum width of the stencil (percents)
minHeightnumberThe minimum height of the stencil (percents)
maxWidthnumberThe maximum width of the stencil (percents)
maxHeightnumberThe maximum height of the stencil (percents)
checkOrientationbooleanCheck if EXIF orientation should be checkedtrue
resizeImageboolean, objectThe options for the image resizing (details)true
moveImageboolean, objectThe options for the image moving (details)true
rotateImageboolean, objectThe options for the image moving (details)false
imageRestrictionstringSet restrictions for image position ('fillArea' 'fitArea', 'stencil', 'none')'fillArea'
defaultSizeobject, FunctionThe function that returns the default size of the stencil or object
defaultPositionobject, FunctionThe function that returns the default position of the stencil or object
defaultTransformsobject, FunctionThe function that returns the default image transforms or object
wrapperComponentComponentThe wrapper componentCropperWrapper
wrapperPropsobjectThe props for the wrapper component{}
backgroundWrapperComponentComponentThe background wrapper componentCropperBackgroundWrapper
backgroundWrapperPropsobjectThe props for the background wrapper component{}

See the documentation for more props and details.

RectangleStencil

PropTypeDescriptionDefault
aspectRationumberThe aspect ratio
minAspectRationumberThe minimum aspect ratio
maxAspectRationumberThe maximum aspect ratio
classNamestringThe class for root block of the stencil component
previewClassNamestringThe class for the preview component
movingClassNamestringThe class applied when user drag the stencil
resizingClassNamestringThe class applied when user resize the stencil
boundingBoxClassstringThe class for the bounding box component
handlerComponentComponentThe handler component
handlersobjectThe object of handlers that should be visible or hidden.
handlerClassNamesobjectThe object of custom handler classes
handlerWrapperClassNamesobjectThe object of custom handler wrapper classes
lineComponentComponentThe handler component
linesobjectThe object of lines that should be visible or hidden.
lineClassNamesobjectThe object of custom line classes
lineWrapperClassNamesobjectThe object of custom line wrapper classes

See the documentation for more props and details.

License

The source code of this library is licensed under MIT, the documentation content belongs to Norserium, except the photos that belong to their respective owners.