ImageUploadProps
type ImageUploadProps = { aspectRatio: ImageUploadAspectRatio; isLoading?: boolean; onSave?: (imageData: ImageData, hasImageChanged: boolean) => void; savedCrop?: Crop; savedImageUrl?: string; title?: string;};Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
aspectRatio |
ImageUploadAspectRatio |
The aspect ratio to enforce for the cropping box. This is a required field. |
isLoading? |
boolean |
A boolean flag indicating if some operation is currently loading. When true, it will render a loading indicator within the component. |
onSave? |
(imageData: ImageData, hasImageChanged: boolean) => void |
Callback function that will be invoked when the user saves the image. The function receives the final image data and a boolean indicating whether the image has changed. |
savedCrop? |
Crop |
The saved crop settings from a previous session. If provided, the cropper will start with this crop selection. |
savedImageUrl? |
string |
The URL of the saved image. This is used to display the image that was previously saved. If provided, the component will start with this image pre-loaded. |
title? |
string |
The title displayed at the top of the ImageUpload modal component. |