Pan & zoom a picture inside a round or square frame, & get the crop as a PNG.
View as MarkdownInstallation
Component API
| Prop | Type | Default | Description |
|---|---|---|---|
src | string | - | 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. | |||
crop | circle | square | circle | A round crop for avatars, or a square one. |
| A round crop for avatars, or a square one. | |||
maxZoom | number | 3 | How far the slider zooms in. |
| How far the slider zooms in. | |||
size | number | 256 | The cropped picture's width and height in pixels. |
| The cropped picture's width and height in pixels. | |||
shape | none | rounded | pill | rounded | |
className | string | - | |
focus | boolean | string | true | |