Cropt is a modern, lightweight image cropper with zero dependencies.
v2 built on the awesome work by DevTheorem.
Demos below and CodePen
Basic with external viewport adjusting:
Cropping from restored preset:
Rotation and resize handles enabled:
<head>
<link rel="stylesheet" href="https://unpkg.com/cropt2@latest/style" />
</head>
<body>
<div id="crop-demo"></div>
</body>
Built for developers who need powerful yet small footprint cropper. Built using modern javascript constructs.
Minimal footprint, zero external dependencies, minimal DOM-manipulation for easy integration.
Pure vanilla JavaScript, ready-shipped in a flexible npm package for use anywhere.
Full TypeScript support, and comes with sample components to use various frameworks.
If you've reviewed the above examples, you're ready to use it: it's that simple! Load up your code editor and let's install it.
npm install cropt2
yarn add cropt2
import Cropt from 'cropt2';
const container = document.getElementById("container-id");
const image_url = "https://raw.githubusercontent.com/mindflowgo/cropt/refs/heads/master/docs/assets/photos/kitten.jpg";
const cropt = new Cropt(container);
cropt.bind(image_url)
console.log( `Crop area: `, cropt.get() )