antd-img-crop
An image cropper for Ant Design Upload
Last updated 9 days ago by nanxiaobei .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install antd-img-crop 
SYNC missed versions from official npm registry.

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

Prop Type Default Description
aspect number 1 / 1 Aspect of crop area , width / height
shape string 'rect' Shape of crop area, 'rect' or 'round'
grid boolean false Show grid of crop area (third-lines)
quality number 0.4 Image quality, 0 ~ 1
zoom boolean true Enable zoom for image
rotate boolean false Enable rotate for image
minZoom number 1 Minimum zoom factor
maxZoom number 3 Maximum zoom factor
modalTitle string 'Edit image' Title of modal
modalWidth number | string 520 Width of modal in pixels number or percentages
modalOk string 'OK' Text of confirm button of modal
modalCancel string 'Cancel' Text of cancel button of modal
beforeCrop function - Call before modal open, if return false, it'll not open
cropperProps object - Props of react-easy-crop (* existing props cannot be overridden)

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

Current Tags

  • 3.13.1                                ...           latest (9 days ago)

59 Versions

  • 3.13.1                                ...           9 days ago
  • 3.13.0                                ...           9 days ago
  • 3.12.0                                ...           a month ago
  • 3.11.0 [deprecated]           ...           a month ago
  • 3.10.0                                ...           2 months ago
  • 3.9.0                                ...           4 months ago
  • 3.8.0 [deprecated]           ...           4 months ago
  • 3.7.0 [deprecated]           ...           4 months ago
  • 3.6.3                                ...           4 months ago
  • 3.6.2 [deprecated]           ...           4 months ago
  • 3.6.1                                ...           4 months ago
  • 3.6.0                                ...           4 months ago
  • 3.5.0 [deprecated]           ...           4 months ago
  • 3.4.2                                ...           4 months ago
  • 3.4.1 [deprecated]           ...           4 months ago
  • 3.4.0                                ...           5 months ago
  • 3.3.0                                ...           5 months ago
  • 3.2.0                                ...           5 months ago
  • 3.1.1                                ...           5 months ago
  • 3.1.0                                ...           5 months ago
  • 3.0.1                                ...           6 months ago
  • 3.0.0                                ...           6 months ago
  • 2.5.0                                ...           6 months ago
  • 2.4.0                                ...           9 months ago
  • 2.3.1                                ...           9 months ago
  • 2.3.0                                ...           10 months ago
  • 2.2.2                                ...           10 months ago
  • 2.2.1                                ...           a year ago
  • 2.2.0                                ...           a year ago
  • 2.1.2                                ...           a year ago
  • 2.1.1                                ...           a year ago
  • 2.0.2                                ...           a year ago
  • 2.0.1                                ...           a year ago
  • 2.0.0                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           2 years ago
  • 0.7.1                                ...           2 years ago
  • 0.7.0                                ...           2 years ago
  • 0.6.1                                ...           2 years ago
  • 0.6.0                                ...           2 years ago
  • 0.5.8                                ...           2 years ago
  • 0.5.5                                ...           2 years ago
  • 0.5.4                                ...           2 years ago
  • 0.5.1                                ...           2 years ago
  • 0.5.0                                ...           2 years ago
  • 0.4.2                                ...           2 years ago
  • 0.4.1                                ...           2 years ago
  • 0.4.0                                ...           2 years ago
  • 0.3.7                                ...           2 years ago
  • 0.3.6                                ...           2 years ago
  • 0.3.5                                ...           2 years ago
  • 0.3.4                                ...           2 years ago
  • 0.3.3                                ...           2 years ago
  • 0.3.2                                ...           2 years ago
  • 0.3.1                                ...           2 years ago
  • 0.2.1                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 62
This Week 981
This Month 3,045
Last Day 165
Last Week 1,385
Last Month 4,444
Dependencies (2)
Dev Dependencies (18)

Copyright 2014 - 2016 © taobao.org |