Rebar UI

1.0

opinion

ImageCropper

Drag the frame to move it, drag a corner to resize, then press Crop.

Crop a van photoSquare crop
Van livery photo
Wide, 16:9
Van livery photo
Disabled
Van livery photo
Custom label
Van livery photo

In context

Project coverCrop the cover before saving it
Harbour rebrand coverWide crop for the project card
Harbour cover photo

Crop to preview the new cover.

Props

PropTypeRequiredDefault
srcstringYes—
altstring | undefinedNo
widthnumber | undefinedNo320
heightnumber | undefinedNo320
aspectRationumber | undefinedNo—
onCrop((dataUrl: string) => void) | undefinedNo—
cropLabelstring | undefinedNoCrop
disabledboolean | undefinedNo—
classNamestring | undefinedNo—

data-rebar-* attributes

data-rebar-component="image-cropper" on the root; parts: stage, rect, handle (each carrying data-rebar-corner).

Migrating to Ant Design

Not codemod-covered — AntD ships no dedicated image cropper; a migration typically keeps this exact drag/resize approach and re-skins the Crop button.