Description
react-avatar-editor is a small React component for avatars and profile pictures. It lets a user resize, crop and rotate an uploaded image in a simple interface, and the result is a cropped image you can save or upload. The component is fully typed in TypeScript, works with React 17, 18 and 19, and has no runtime dependencies. It offers a rounded or square crop area and a built-in loading indicator. A useAvatarEditor hook gives you the editor's methods without managing a ref yourself: getImage returns the crop at the original resolution, getImageScaledToCanvas returns it scaled to the editor's size, which is usually what an avatar needs, and getCroppingRect returns the crop area as a fraction of the image. The README advises saving as JPEG when file size matters, because PNG is lossless and a cropped camera photo can be several times larger, and it warns that transparent areas turn black in JPEG unless a background color is set. Width and height can also be a percentage of the parent element, and the editor follows that parent when it resizes while keeping the image, position and zoom. The README includes examples with a basic setup, the hook, a ref, drag and drop with react-dropzone, and animated rotation. The project is open source on GitHub.…
Highlights
- Resize, crop and rotate uploaded images
- Round or square crop area
- Fully typed TypeScript with no runtime dependencies
- useAvatarEditor hook for editor methods
- Responsive sizing from the parent element
Ratings & Reviews
No ratings yet
Be the first to rate react-avatar-editor.
People also visit
react-avatar-editor FAQ
What is react-avatar-editor?
A React component for cropping, resizing and rotating avatar and profile pictures in a simple interface.
Which React versions does it support?
React 17, 18 and 19.
Should I save as JPEG or PNG?
The README suggests JPEG for smaller files, since PNG is lossless and can be several times larger for a cropped photo. Transparent areas turn black in JPEG unless you set a background color.
Which output should I use?
getImageScaledToCanvas returns the crop at the editor's size, which is usually right for avatars. getImage returns the full original resolution.
Does it have runtime dependencies?
No. The README lists zero runtime dependencies.
What are the best react-avatar-editor alternatives?
Popular alternatives to react-avatar-editor include react-image-crop, react-cropper and react-gravatar. See all react-avatar-editor alternatives
















