3.9.7 • Published 4 years ago

aiz-img-crop v3.9.7

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

antd-img-crop

An image cropper for Ant Design Upload.

npm npm npm bundle size GitHub

English | 简体中文

Demo

Live demo

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

PropTypeDefaultDescription
aspectnumber1 / 1Aspect of crop area , width / height
shapestring'rect'Shape of crop area, 'rect' or 'round'
gridbooleanfalseShow grid of crop area (third-lines)
zoombooleantrueEnable zoom for image
rotatebooleanfalseEnable rotate for image
beforeCropfunction-Called before modal open, if return false, it'll not open
modalTitlestring'Edit image'Title of modal
modalWidthnumber | string520Width of modal in pixels or percentages
modalOkstring'OK'Text of confirm button of modal
modalCancelstring'Cancel'Text of cancel button of modal

Styles

To prevent overwriting the custom styles to antd, antd-img-crop does not import the style files of components.

Therefore, if your project configured babel-plugin-import, and not use Modal or Slider, you need to import the styles yourself:

import 'antd/es/modal/style';
import 'antd/es/slider/style';

License

MIT License (c) nanxiaobei

3.9.7

4 years ago

3.9.6

4 years ago

3.9.5

4 years ago

3.9.4

4 years ago

3.9.3

4 years ago

3.9.2

4 years ago

3.9.1

4 years ago