Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@boyuai/antd-img-crop

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@boyuai/antd-img-crop

An image cropper for Ant Design Upload

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

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.

Keywords

FAQs

Package last updated on 28 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc