zhoujingsai / antd-img-crop

🔪 An image cropper to wrap Upload in Ant Design

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

antd-img-crop

npm

An image cropper to wrap Upload in Ant Design

Demo

https://codesandbox.io/s/y3y6y80yk1

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

modalTitle

type: string, default: "编辑图片"

width

type: number, default: 100

height

type: number, default: 100

Use width and height to get ratio for crop area. (Not use them as the real length)

scale

type: number, default: 80

Use scale for the crop area size. (e.g. if scale = 100, then crop area will fill the full width or height)

About

🔪 An image cropper to wrap Upload in Ant Design

License:MIT License


Languages

Language:JavaScript 97.9%Language:CSS 2.1%