
Avatar Upload
Forms
Search by name, tag, category or type
Source and install need .
pnpm dlx shadcn@latest add @assembli/image-cropperA photo cropper for avatars and covers: drag to reposition, scroll or pinch to zoom toward the pointer, straighten on a ruler dial, rotate and flip. The image always covers the crop at any angle, thirds appear while you adjust, and the outside dims (round for avatars). Keyboard pan, zoom and rotate, natural-pixel coordinates, plus drawCrop and cropToBlob to export.
Other props pass through to the root element.
src*
string
alt
string
Default ""
aspects
CropAspect[]
Default DEFAULT_ASPECTS
Shapes to choose from. One hides the switcher. Defaults to Square, Portrait, Wide and Original.
defaultAspect
number
Default 0
Index into aspects.
height
number
Default 360
Height of the editing stage in px. Defaults to 360.
maxZoom
number
Default 5
How far past "fills the crop" you can zoom. Defaults to 5.
onCropChange
(area: CropArea) => void
Fires as the crop changes, with natural-pixel coordinates for drawCrop / cropToBlob or your server.
crossOrigin
"anonymous" | "use-credentials"
Default "anonymous"
Sent on the <img>; keep "anonymous" for remote images you want to export.
| Prop | Type | Default | Description |
|---|---|---|---|
| src* | string | – | |
| alt | string | "" | |
| aspects | CropAspect[] | DEFAULT_ASPECTS | Shapes to choose from. One hides the switcher. Defaults to Square, Portrait, Wide and Original. |
| defaultAspect | number | 0 | Index into aspects. |
| height | number | 360 | Height of the editing stage in px. Defaults to 360. |
| maxZoom | number | 5 | How far past "fills the crop" you can zoom. Defaults to 5. |
| onCropChange | (area: CropArea) => void | – | Fires as the crop changes, with natural-pixel coordinates for drawCrop / cropToBlob or your server. |
| crossOrigin | "anonymous" | "use-credentials" | "anonymous" | Sent on the <img>; keep "anonymous" for remote images you want to export. |