
Security News
New CVE Forecasting Tool Predicts 47,000 Disclosures in 2025
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
cropper-react
Advanced tools
CropperJs as a react component
$ npm install cropper-react
You need to import cropper styles from cropperjs
import '../node_modules/cropperjs/dist/cropper.css';
import Cropper from "cropper-react";
import '../node_modules/cropperjs/dist/cropper.css';
const buttonStyle = {
border: '1px solid #ccc',
padding: '5px 15px',
fontSize: '16px',
color: 'black',
background: 'white',
marginTop: '20px'
};
export const MyCropper = () => {
const image = useRef<HTMLImageElement>();
const cropImage = useCallback(() => {
const dataUrl = image.current.cropper.getCroppedCanvas({ width: 624 }).toDataURL('image/jpeg', 0.9);
console.log(dataUrl); // do something with the image, save to server etc
}, [image]);
return (<div>
<div style={{ height: '500px' }}>
<Cropper ref={image} image="https://fengyuanchen.github.io/cropperjs/images/picture.jpg" />
</div>
<button style={buttonStyle} onClick={cropImage}>Crop Image</button>
</div >)
};
Supports same props as CropperJs see example and docs
Want to contribute? Great! please open a PR here
FAQs
CropperJs as react component using react hooks internally
The npm package cropper-react receives a total of 36 weekly downloads. As such, cropper-react popularity was classified as not popular.
We found that cropper-react demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.