React image editor
Add cropping, annotation and filters to your React app with one hook. The editor opens as an accessible full-screen modal and gives you back a File you can upload.
This is the real editor (v1.6.1). Pick a tool and try it.More demos, including multi-image →
Install
npm install @rageshpikalmunde/rp-image-editor @rageshpikalmunde/rp-image-editor-reactUsage
import { useRpImageEditor } from '@rageshpikalmunde/rp-image-editor-react';
export function AvatarUpload() {
const { openEditor, openMultiEditor } = useRpImageEditor();
async function onFile(e: React.ChangeEvent<HTMLInputElement>) {
const file = e.target.files?.[0];
if (!file) return;
const result = await openEditor(file, { exportFormat: 'jpeg' });
if (result) upload(result.file); // File, Blob and base64 are all returned
}
return <input type="file" accept="image/*" onChange={onFile} />;
}
Prefer it inline? Render <RpImageEditorComponent image={file} onImageEdited={save} /> instead of the modal. Works with Next.js (load it client-side), Vite, CRA and Ionic React.
What you get
- Crop, rotate, flipAspect-ratio presets, rule-of-thirds guide, keyboard nudging.
- AnnotateDraw, text, arrows, shapes and callouts that stay attached through crop and rotate.
- Filters & adjustSeven filters with live previews, plus brightness, contrast, saturation and blur.
- Multi-imageEdit a batch with a thumbnail strip and per-image undo.
- AccessibleWCAG 2.2 AA, full keyboard support, focus management.
- Mobile-readyBottom tool bar, 44 px targets, pinch zoom, HEIC support.
- 15 languagesBuilt-in translations, every string overridable, light and dark themes.
- Full-quality exportPNG or JPEG at the original resolution, as File, Blob or base64.
Questions
Does it work with Next.js?
Yes. The editor uses the DOM and canvas, so load it on the client (for example inside useEffect or with next/dynamic and ssr: false).
Can users edit several images at once?
Yes: openMultiEditor(files) shows a thumbnail strip, keeps separate undo history per image and returns every image with an edited flag.
Is it typed?
Yes. The packages are written in TypeScript and ship their type definitions.