@boyuai/antd-img-crop
An image cropper for Ant Design Upload
Last updated a year ago by tripley .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @boyuai/antd-img-crop 
SYNC missed versions from official npm registry.

antd-img-crop

npm

English | 简体中文

An image cropper for Ant Design Upload.

Demo

https://codesandbox.io/s/4qoom5p9x4

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

width

type: number, default: 100

Crop width in px. If useRatio is true, it'll be ratio.

height

type: number, default: 100

Crop height in px. If useRatio is true, it'll be ratio.

useRatio

type: boolean, default: false

If use width and height as ratio, not real px. And crop will fill the width or height.

e.g. width={500} height={400} and width={5} height={4} are exactly the same.

resize

type: boolean, default: true

If crop can resize.

resizeAndDrag

type: boolean, default: true

If crop can resize and drag.

modalTitle

type: string, default: "Edit image"

Modal title.

modalWidth

type: number, default: 520

Modal width in px.

beforeCrop

type: function, default: -

Execute before crop, if return false, modal will not open. (Not support Promise)

Ant Design Upload beforeUpload prop will execute after crop, before upload.

Current Tags

  • 1.0.0                                ...           latest (a year ago)

1 Versions

  • 1.0.0                                ...           a year ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (3)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |