Skip to content

Image Cropper

Last updated 24 Nov 2026

NbImageCropper allows users to select and crop an image with precision. It supports circular and rectangular crops, aspect ratio locking, and a real-time preview of the cropped output.

Props ​

PropTypeDefaultDescription
imageFile | nullnullThe image file to crop
cropAsCirclebooleanfalseDisplay the crop area as a circle overlay
outputAsCirclebooleanfalseOutput the cropped image with transparent corners (circle PNG)
lockAspectRatiobooleanfalseMaintain the crop area aspect ratio during resizing
showPreviewbooleanfalseDisplay a live preview of the cropped image and geometry
initialCrop'center' | 'full''center'Where the crop area starts: half the image, centred, or the whole image. A square crop always starts square
fit'fixed' | 'container''fixed'Draw the image in 700 by 400, or at the width the cropper is given (up to 60% of the window's height), following it as it changes

On a touch phone, the resize handles grow a little and take touches in a 44px area around them, and a drag on the image never scrolls the page.

Events ​

EventPayloadDescription
crop{ blob: Blob; geometry: { x, y, width, height } }Emitted when the user crops the image

The blob is ready to upload via FormData. The geometry object contains the crop rectangle in the original image's coordinate space.