1.0.1 • Published 4 years ago

jk-clip v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

antd-img-crop

An image cropper for Upload of Ant Design.

npm npm npm bundle size GitHub

English | 简体中文

Demo

Edit antd-img-crop

Install

yarn add antd-img-crop

Usage

import ImgCrop from 'antd-img-crop';
import { Upload } from 'antd';

const Demo = () => (
  <ImgCrop>
    <Upload>+ Add image</Upload>
  </ImgCrop>
);

Props

NameTypeDefaultDescription
widthnumber100Width of cropped image in px
heightnumber100Height of cropped image in px
containbooleanfalseConsistent with background-size: contain, crop area will fill the width or height
resizebooleantrueIf crop area can resize
resizeAndDragbooleantrueIf crop area can resize and drag
modalTitlestring'Edit image'Title of modal
modalWidthnumber520Width of modal in px
beforeCropfunction-If return false, modal will not open. Call order: beforeCrop → crop → beforeUpload → upload
rotatebooleanfalseIf image can rotate
rotateLabelstring'Rotate'Rotate label

new File error? try https://github.com/jimmywarting/FormData/issues/11#issuecomment-277522987

License

MIT License (c) nanxiaobei