Vue.js Image Clipping Components Using Vue-Rx | vuejs-clipper

Vue.js image cropping components using Vue-Rx. Add Image Crop components to your Vue app in anything flat. Touch devices are fully supported and responsive.

vue image crop upload, vue cropper example, vue advanced cropper example, vue avatar cropper, vuetify image cropper, image cropper in html, vue 3 image cropper

Table of Contents

How to make use of it:

Install and download:

# NPM
$ npm install vuejs-clipper --save

1. Import the vuejs-clipper component and other required resources.

import Vue from 'vue'
import VueRx from 'vue-rx'
import VuejsClipper from 'vuejs-clipper'

2. Register the component.

// vue-rx
Vue.use(VueRx)

// vuejs-clipper
Vue.use(VuejsClipper)

3. Add a basic image cropping tool to the template.

<clipper-basic src="example.jpg">
</clipper-basic>

4. Props available for clipperBasic component.

preview: {
  type: String,
  default: ''
},
src: {
  type: String,
  default: ''
},
border: {
  type: Number,
  default: 1
},
outline: {
  type: Number,
  default: 6
},
corner: {
  type: Boolean,
  default: true
},
grid: {
  type: Boolean,
  default: true
},
mode: {
  type: String,
  default: 'normal'
},
ratio: {
  type: Number,
  default: NaN
},
wrapRatio: {
  type: Number,
  default: NaN
},
touchCreate: {
  // enable/disable create new zoom area in touch device;
  type: Boolean,
  default: true
},
rotate: {
  type: Number,
  default: 0
},
bgColor: {
  type: String,
  default: 'white'
},
lineColor: {
  type: String,
  default: '#1baae8'
},
shadow: {
  type: String,
  default: 'rgba(0, 0, 0, 0.4)'
},
scale: {
  type: Number,
  default: 1
},
minWidth: {
  type: Number,
  default: 1
},
minHeight: {
  type: Number,
  default: 1
},
initWidth: {
  type: Number,
  default: 50
},
initHeight: {
  type: Number,
  default: 50
},
crossOrigin: {
  type: String,
  default: undefined
}

5. Props available for clipperFixed component.

src: {
  type: String,
  default: ''
},
rotate: {
  type: Number,
  default: 0
},
ratio: {
  type: Number,
  default: 1
},
zoomRate: {
  type: Number,
  default: 0.04
},
minScale: {
  type: Number,
  default: 0.1
},
bgColor: {
  type: String,
  default: 'white'
},
border: {
  type: Number,
  default: 1
},
borderColor: {
  type: String,
  default: 'white'
},
grid: {
  type: Boolean,
  default: true
},
shadow: {
  type: String,
  default: 'rgba(0, 0, 0, 0.4)'
},
round: {
  type: Boolean,
  default: false
},
preview: {
  type: String,
  default: ''
},
crossOrigin: {
  type: String,
  default: undefined
},
area: {
  type: Number,
  default: 50
},
handleZoomEvent: {
  type: Function,
  default: val => val
}

6. Props available for clipperRange component.

value: {
  type: Number,
  default: 0
},
max: {
  type: Number,
  default: 10
},
min: {
  type: Number,
  default: 0
}

7. Props available for clipperUpload component.

exif: {
  type: Boolean,
  default: true
},
value: {
  type: String,
  default: ''
},
check: {
  type: Boolean,
  default: true
}

Props

PropTypedefaultdescription
srcstring image src
previewstring matches clipper-preview‘s name to show preview image.
bordernumber1border width
outlinenumber6outlines near by the border to help user zooming.
cornerbooleantrueshow corner layout
gridbooleantrueshow grid layout
rationumber ratio of clipping area (width/height). ex: 14/3 .
wrap-rationumberNaNratio of clipping container (width/height). ex: 14/3 .
mode‘normal’/’switch’‘normal’if ratio is set, this prop will affect how clipping area zoom.
bg-colorstring‘white’background color
lineColorstring‘#1baae8’clip box line color
shadowstring‘rgba(0,0,0,0.4)’shadow color
rotatenumber0rotate degree
scalenumber1transform scale
min-widthnumber1minimum width(%) of clipping box related to clipping component’s width
min-heightnumber1minimum height(%) of clipping box related to clipping component’s height.
init-widthnumber50clipping area’s width(%) when the image loaded.
init-heightnumber50clipping area’s height(%) when the image loaded.
touch-createbooleantrueenable/disable create new clipping area on touch device
cross-originstringundefinedcrossorigin attribute of <img /> inside clipper. ex: anonymous

Vue.js Image Cropping Components, vuejs-clipper Plugin/Github


See Demo And Download

Official Website(timtnleeProject): Click Here

This superior jQuery/javascript plugin is developed by timtnleeProject. For extra Advanced Usages, please go to the official website.

Related Posts

Iconpicker-Bootstrap-5

[Icon Picker] Iconpicker for Bootstrap 5 Icons Library

Bootstrap 5-based icon picker which supports any icon libraries like Bootstrap Icons, Font Awesome[fontawesome.com], etc. Must Read: 1000+ Pixel Perfect SVG Icons For Vue Components | Unicons How…

bootstrap-multiple-image-upload-with-preview

Bootstrap Multiple Image Upload with Preview and Delete | ImagesLoader

ImagesLoader is a standard bootstrap image upload plugin that provides an easy-to-use and nice-looking interface for uploading multiple images to a web server. Must Read: HTML 5…

Animating-Split-Flap-Displays-fallblatt

A Lightweight jQuery Plugin for Animating Split-Flap Displays | fallblatt

fallblatt is a lightweight jQuery plugin for animating split screens. This jQuery plugin allows you to include such offers in your web application. Everything from virtual departure…

bootstrap-5-dark-theme

Dark & Light Switch Mode Toggle for Bootstrap 5

Switching to dark mode is done by toggling HTML tags that include -dark or -light as a category. It is made by manipulating the DOM with JavaScript. The text color also changes depending…

jQuery-SyoTimer-Plugin

jQuery Plugin for Countdown Timer on HTML Page | SyoTimer

yoTimer jQuery plugin allows you to create digital style countdowns/periodic timers on the webpage, with callbacks support and timezone/translation customization. Features Periodic count with the specified period…

vue-js-periodic-table

Dynamic, Data-driven Periodic Table built with Vue.js

Periodicity is a dynamic, data-driven periodic table created with Vue.js that uses D3 animations and graphs to show the beauty of periodic trends. Built With vue.js (component…