API
ImageUploadProps
Name | Description | Type | Default |
---|---|---|---|
children | custom upload zone | React.ReactNode | |
width | image width | number | 100 |
height | image height | number | width |
value | default images | string | ValueItem | (string | ValueItem)[] | [] |
onChange | callback for when the images changes | (value: ImageItem[] ) => void | |
onUpload | callback for when the drop event occurs | (file: File ) => string | Promise<string> | (file: File) => URL.createObjectURL(file) |
max | max image number | number | Infinity |
readonly | for preview | boolean | |
className | root className | string | |
itemClassName | image className | string | |
dropzoneClassName | dropzone className | string | |
dropzoneOptions | DropzoneOptions | ||
photoProviderProps | Omit<PhotoProviderProps, "children"> |
Types
type ValueItem = {
url: string;
name?: string;
};
type ImageItem = {
id: string;
url?: string;
name?: string;
file?: File;
loading?: boolean;
};