Lightweight, Awesome Vanilla JS Image Cropper | Croppr.js

Croppr.js is a lightweight and gorgeous vanilla javascript image crop that has absolutely no dependencies.

Features:

  • Lightweight (<6KB minified and compressed)
  • Made only with delicious Original Vanilla JS
  • Zero Dependencies
  • Supports touch devices!
  • TypeScript writing included!

A Simple Picture Image Cropper Clipping Plugin for Vue.js

How to make use of it:

Installation:

npm install croppr -—save
// CommonJS
var Croppr = require('croppr');

// ES6 import
import Croppr from 'croppr';

Usage

<img src="path/to/image.jpg" id="croppr"/>
var cropInstance = new Croppr('#croppr', {
  // ...options
});

Options

aspectRatio

Constrain the crop region to an aspect ratio.

  • Type: Number
  • Default: null
  • Example: aspectRatio: 1 (Square)

maxSize

Constrain the crop region to a maximum size.

  • Type: [width, height, unit?]
  • Default: null
  • Example: maxSize: [50, 50, '%'] (A maximum size of 50% of the image size)

Note: unit accepts a value of ‘px’ or ‘%’. Defaults to ‘px’.

minSize

Constrain the crop region to a minimum size.

  • Type: [width, height, unit?]
  • Default: null
  • Example: minSize: [20, 20, 'px'] (A minimum width and height of 20px)

Note: unit accepts a value of ‘px’ or ‘%’. Defaults to ‘px’.

startSize

The starting size of the crop region when it is initialized.

  • Type: [width, height, unit?]
  • Default: [100, 100, '%'] (A starting crop region as large as possible)
  • Example: startSize: [50, 50] (A starting crop region of 50% of the image size)

Note: unit accepts a value of ‘px’ or ‘%’. Defaults to ‘%’.

native javascript image cropper library, Croppr.js plugin/github


See Demo And Download

Official Website(jamesssooi): Click Here

This superior jQuery/javascript plugin is developed by jamesssooi. For extra advanced usage, please go to the official website.

Related Posts

VenoBox-Responsive-jQuery-Lightbox-Plugin

Responsive Image Gallery Lightbox jQuery Plugin | VenoBox

VenoBox is a responsive jQuery modal window plugin suitable for images, embedded content, iFrames, Google Maps, Vimeo, and YouTube videos. The big difference compared to many other…

bootstrap-dropdown-on-hover

[Animation] Bootstrap Multi-Level Responsive Dropdown Menu

Bootstrap-based multi-level dropdown navigation menu with cool animations. The dropdown on Hover is a jQuery plugin used to create Bootstrap multi-level scroll-triggered dropdown menus with CSS3 animations…

Google-Translate-Dropdown-Customize-With-Country-Flag

Google Translate Dropdown Customize With Country Flag | GT API

Flag google translates jQuery text that takes advantage of the Google Cloud Translation API to translate web content between languages by selecting a country from the dropdown…

Bootstrap-Fileinput

HTML 5 File Input Optimized for Bootstrap 4.x./3.x with File Preview | Bootstrap Fileinput

bootstrap-fileinput is an improved HTML 5 file input  Bootstrap 5.x, 4.x and 3.x with file preview for different files, provides multiple selections, resumable section uploads, and more….

Data-Table-Generator-Tabulator

Interactive Data Table Generator with JS/jQuery and JSON | Tabulator

Tabulator allows you to create interactive tables in seconds from any HTML Table, JavaScript array, AJAX data source, or JSON format data. Just include the library in your…

alert-confirm-prompt-attention-js

Simple Alert, Confirm, Prompt Popup Using Vanilla JavaScript Library | attention.js

JavaScript provides various built-in functionality to display popup messages for different purposes. Attention JS is a vanillaJS plugin used to create a custom alert, confirm, or Prompt…

Leave a Reply

Your email address will not be published. Required fields are marked *