An image cropper to wrap Upload in Ant Design
https://codesandbox.io/s/y3y6y80yk1
yarn add antd-img-crop
import ImgCrop from 'antd-img-crop';
import { Upload } from 'antd';
const Demo = () => (
<ImgCrop>
<Upload>+ Add image</Upload>
</ImgCrop>
);
type: string
, default: "编辑图片"
type: number
, default: 100
type: number
, default: 100
Use width
and height
to get ratio for crop area. (Not use them as the real length)
type: number
, default: 80
Use scale
for the crop area size. (e.g. if scale = 100
, then crop area will fill the full width or height)