Skip to main content

Image Cropper

Pan & zoom a picture inside a round or square frame, & get the crop as a PNG.

View as Markdown

Installation

Component API

PropTypeDefaultDescription
srcstring-The picture to crop.
The picture to crop.
onChange(png: string) => void-Called with the cropped picture as a PNG, after each pan or zoom settles.
Called with the cropped picture as a PNG, after each pan or zoom settles.
cropcircle | squarecircleA round crop for avatars, or a square one.
A round crop for avatars, or a square one.
maxZoomnumber3How far the slider zooms in.
How far the slider zooms in.
sizenumber256The cropped picture's width and height in pixels.
The cropped picture's width and height in pixels.
shapenone | rounded | pillrounded
classNamestring-
focusboolean | stringtrue