react-picture-cropper
v0.1.8
Published
An react component to crop and upload pictures at the front-end
Downloads
5
Maintainers
Readme
React picture cropper is a React component for picture cropping and uploading from the front-end.
Example Usage
- 1.Install the package:
npm install react-picture-cropper
- 2.Import the component to your code as a normal React component:
import PicCropper from "react-picture-cropper"
import { render } from "react-dom"
import React from "react"
function App(){
return(
<PicCropper action="path"/>
)
}
render(
App(),
document.getElementById("root")
)
action: The path you upload your image
Demo
- 1.Enter the root directory of the module(in node_modules)
- 2.Run the demo
npm run demo1
- 3.Visit http://localhost:8080/index.html in your browser
- 4.Select one pic and upload it the your local server, you'll find the uploaded picture at /demo/upload/ as "fileData.png"