1.0.11 • Published 5 years ago

arwy-image-cropper-react v1.0.11

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

arwy-image-cropper-react

NPM JavaScript Style Guide

Intention

This is a small component for clipping images. It supports mouse and touch events.
You give a base64image in and get the cropped image back at every user interaction.

Props

thumbSize:width and height of the thumbnail
src:base64image source
preview:displays the thumbnail on ImageCropper. this prop is for debugging
onChange:callback to get thumb in base64 format

|

important you should set height of the ImageCropper parent container

Install

npm install --save arwy-image-cropper-react

Usage

import * as React from 'react'

import { ImageCropper}  from 'arwy-image-cropper-react'

class Example extends React.Component {

  render () {

    let src = "data:image .....
    
    let handleOnChange = (base64Image) => { 
      console.log('base64Image:', base64Image);
    };

    return (
      <ImageCropper onChange={handleOnChange} src={src} thumbSize={{ width: 50, height: 50 }} preview />
    )
  }
}

License

MIT © make4711

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago