0.1.8 • Published 1 year ago

react-tiny-cropper v0.1.8

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

React-tiny-cropper

A React cropper component which compatible with lots of shaps such as rectangle,square,circle,polygon.The operation on PC or Mobile are both supportted.

Demo

npm.io

Install

$ npm install react-tiny-cropper
or
$ yarn add react-tiny-cropper

properties

nametypedefaultdescription
typestringrectanglethe shap of cropper,circle,square,rectangle and polygon are allowed
imagestring-the image need to crop
styleobject-the custom style of cropper box
nodesNumnumberd4the number of nodes which could press to move(it's not effective unless type is "polygon")
configsobject-configs
onResultfuction(url:base64)-The callback function that is triggered when CropperBox is moving or resizing

configs

nametypedefaultdescription
backgroundColorstringrgba(24,144,255,0.5)The color of background
maskColorstringrgba(0,0,0,0.6)The color of mask
cropColorstringrgba(24,144,255,1)The color of CropperBox

Usage

import Cropper from "react-tiny-cropper";

function Demo() {
  const oncrop = (e: string) => {
      // e:base64
  };

  return(
         <Cropper
            image='XXX.png'
            onResult={oncrop}
            style={{width:"200px",height:"200px"}}
          />
    )
}
0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago