Git Product home page Git Product logo

cropping's Introduction

rc-cropping


React Cropping Component

NPM version build status Test coverage gemnasium deps node version npm download

Feature

  • Cropping pictures in facebook mode.
  • Cropping result preview.
  • Supports exporting circle and square picture.
  • I18n.
  • [FUTURE] Rotate picture.

Screenshots

Development

npm install
npm start

Example

http://localhost:8001/examples/

online example: http://react-component.github.io/cropping/

install

rc-cropping

Usage

var Cropping = require('rc-cropping');
var React = require('react');

ReactDOM.render(<CropViewer
  getSpinContent={() => <span>loading...</span> }
  renderModal={() => <Dialog />}
  circle={true}
/>, document.getElementById('__react-content'));

API

props

name type default description
className String additional css class of root dom node
getSpinContent Function() => React.Component spin content of Cropper
renderModal Function() => React.Component Modal Render of Component, you can pass any React Component to replace it.
locale 'en-US' | 'zh-CN' i18n locale.
circle boolean false Croppe circle image or not. If true, you'll get a circle picture. Notice: transparent background *ONLY* supported in png file, croppe jpg file will get white background.
resizer function null Cropper support custom image resize function, e.g., you can use [pica](https://github.com/nodeca/pica) to down scale your picture more perfectly

Test Case

npm test
npm run chrome-test

Coverage

npm run coverage

open coverage/ dir

License

rc-cropping is released under the MIT license.

cropping's People

Contributors

raohai avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.