antd-img-crop-royaltymine

2.5.4 • Public • Published

antd-img-crop

An custom royaltymine image cropper for Ant Design Upload.

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

Name Type Default Description
width number 100 Width of cropped image in px.
height number 100 Height of cropped image in px.
contain boolean false Consistent with background-size: contain, crop area will fill the width or height.
useRatio - - Deprecated, please use contain.
resize boolean true If crop area can resize.
resizeAndDrag boolean true If crop area can resize and drag.
modalTitle string "Edit image" Title of modal.
modalWidth number 520 Width of modal in px.
beforeCrop function - Execute before crop, modal will not open if return false (Not support Promise). beforeUpload prop of Upload will execute after crop, before upload.

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

License

MIT License (c) nanxiaobei

Package Sidebar

Install

npm i antd-img-crop-royaltymine

Weekly Downloads

1

Version

2.5.4

License

MIT

Unpacked Size

56.2 kB

Total Files

8

Last publish

Collaborators

  • duncanlevings