A responsive image cropping tool for React

Overview

This documentation refers to v10. Go to 9.1.1 tag for v9 docs.

React Image Crop

An image cropping tool for React with no dependencies.

React Image Crop on NPM

CodeSanbox Demo

ReactCrop GIF

Table of Contents

  1. Features
  2. Installation
  3. Usage
  4. Example
  5. CDN
  6. Props
  7. FAQ
    1. How can I generate a crop preview in the browser?
    2. How to correct image EXIF orientation/rotation?
    3. How to filter, rotate and annotate?
    4. How can I center the crop?
  8. Contributing / Developing

Features

  • Responsive (you can use pixels or percentages).
  • Touch enabled.
  • Free-form or fixed aspect crops.
  • Fully keyboard accessible (a11y).
  • No dependencies/small footprint (5KB gzip).
  • Min/max crop size.
  • Crop anything, not just images.

If React Crop doesn't cover your requirements then take a look at Pintura. It features cropping, rotating, filtering, annotation, and lots more.

Learn more about Pintura here

Installation

npm i react-image-crop --save
yarn add react-image-crop

This library works with all modern browsers. It does not work with IE.

Usage

Include the main js module:

import ReactCrop from 'react-image-crop'

Include either dist/ReactCrop.css or ReactCrop.scss.

import 'react-image-crop/dist/ReactCrop.css'
// or scss:
import 'react-image-crop/src/ReactCrop.scss'

Example

function CropDemo({ src }) {
  const [crop, setCrop] = useState<Crop>()
  return (
    <ReactCrop crop={crop} onChange={c => setCrop(c)}>
      <img src={src} />
    </ReactCrop>
  )
}

See the sandbox demo for a more complete example.

CDN

<script src="https://unpkg.com/react-image-crop/dist/ReactCrop.min.js"></script>

Note when importing the script globally using a <script> tag access the component with ReactCrop.Component.

Props

onChange: (crop: PixelCrop, percentCrop: PercentCrop) => void

A callback which happens for every change of the crop (i.e. many times as you are dragging/resizing). Passes the current crop state object.

Note you must implement this callback and update your crop state, otherwise nothing will change!

<ReactCrop crop={crop} onChange={(crop, percentCrop) => setCrop(crop)} />

crop and percentCrop are interchangeable. crop uses pixels and percentCrop uses percentages to position and size itself. Percent crops are resistant to image/media resizing.

crop?: Crop

Starting with no crop:

const [crop, setCrop] = useState<Crop>()

<ReactCrop crop={crop} onChange={c => setCrop(c)}>
  <img src={src} />
</ReactCrop>

Starting with a preselected crop:

const [crop, setCrop] = useState<Crop>({
  unit: '%', // Can be 'px' or '%'
  x: 25,
  y: 25,
  width: 50,
  height: 50
})

<ReactCrop crop={crop} onChange={c => setCrop(c)}>
  <img src={src} />
</ReactCrop>

⚠️ You must ensure the crop is in bounds and correct to the aspect ratio if manually setting. Aspect ratios can be tricky when using %. You can make use of centerCrop and makeAspectCrop helpers. See How can I center the crop? or the CodeSanbox Demo for examples.

aspect?: number

The aspect ratio of the crop, e.g. 1 for a square or 16 / 9 for landscape. Omit/pass undefined for a free-form crop.

minWidth?: number

A minimum crop width, in pixels.

minHeight?: number

A minimum crop height, in pixels.

maxWidth?: number

A maximum crop width, in pixels.

maxHeight?: number

A maximum crop height, in pixels.

keepSelection?: boolean

If true is passed then selection can't be disabled if the user clicks outside the selection area.

disabled?: boolean

If true then the user cannot resize or draw a new crop. A class of ReactCrop--disabled is also added to the container for user styling.

locked?: boolean

If true then the user cannot create or resize a crop, but can still drag the existing crop around. A class of ReactCrop--locked is also added to the container for user styling.

className?: string

A string of classes to add to the main ReactCrop element.

style?: React.CSSProperties

Inline styles object to be passed to the image wrapper element.

onComplete?: (crop: PixelCrop, percentCrop: PercentCrop) => void

A callback which happens after a resize, drag, or nudge. Passes the current crop state object.

percentCrop is the crop as a percentage. A typical use case for it would be to save it so that the user's crop can be restored regardless of the size of the image (for example saving it on desktop, and then using it on a mobile where the image is smaller).

onDragStart?: (e: PointerEvent) => void

A callback which happens when a user starts dragging or resizing. It is convenient to manipulate elements outside this component.

onDragEnd?: (e: PointerEvent) => void

A callback which happens when a user releases the cursor or touch after dragging or resizing.

renderSelectionAddon?: (state: ReactCropState) => React.ReactNode

Render a custom element inside crop the selection.

ruleOfThirds?: boolean

Show rule of thirds lines in the cropped area. Defaults to false.

circularCrop?: boolean

Show the crop area as a circle. If your aspect is not 1 (a square) then the circle will be warped into an oval shape. Defaults to false.

FAQ

How can I generate a crop preview in the browser?

This isn't part of the library but there is an example over here CodeSandbox Demo.

How to correct image EXIF orientation/rotation?

You might find that some images are rotated incorrectly. Unfortunately this is a browser wide issue not related to this library. You need to fix your image before passing it in.

You can use the following library to load images, which will correct the rotation for you: https://github.com/blueimp/JavaScript-Load-Image/

You can read an issue on this subject here: #181

If you're looking for a complete out of the box image editor which already handles EXIF rotation then consider using Pintura.

How to filter, rotate and annotate?

This library is deliberately lightweight and minimal for you to build features on top of. If you wish to perform more advanced image editing out of the box then consider using Pintura.

Pintura Demo

How can I center the crop?

The easiest way is to use the percentage unit:

crop: {
  unit: '%',
  width: 50,
  height: 50,
  x: 25,
  y: 25
}

Centering an aspect ratio crop is trickier especially when dealing with %. However two helper functions are provided:

  1. Listen to the load event of your media to get its size:
<ReactCrop crop={crop} aspect={16 / 9}>
  <img src={src} onLoad={onImageLoad} />
</ReactCrop>
  1. Use makeAspectCrop to create your desired aspect and then centerCrop to center it:
function onImageLoad(e) {
  const { naturalWidth: width, naturalHeight: height } = e.currentTarget;

  const crop = centerCrop(
    makeAspectCrop(
      {
        // You don't need to pass a complete crop into
        // makeAspectCrop or centerCrop.
        unit: '%',
        width: 90,
      },
      16 / 9,
      width,
      height
    ),
    width,
    height
  )

  setCrop(crop)
}

Also remember to set your crop using the percentCrop on changes:

const onCropChange = (crop, percentCrop) => setCrop(percentCrop)

Contributing / Developing

To develop run yarn start, this will recompile your JS and SCSS on changes.

You can test your changes by opening test/index.html in a browser (you don't need to be running a server).

Comments
  • Retain Image Quality after Crop on front-end?

    Retain Image Quality after Crop on front-end?

    I am curious if this package retains the quality of the original image after the crop... if cropping happens on the front end as is shown in the demo?

    The reason I ask is when I use the example (as shown below), the resulting crop looks a lot more pixelated and less quality image so I am curious if that is what the end result is on the front end?

    screenshot

    The workaround would be to pass the crop parameters and the original image to backend and have another package crop the image, but that would require a lot more work so is there a way to do this well on the front-end?

    opened by Andriy-Kulak 34
  • crop box resets offset when hits the bottom

    crop box resets offset when hits the bottom

    hi, i have this weird behaviour... not in all images, but with some particular images when i hit the image bottom boundary, the crop box goes back the top... any suggestion? thank you! Matteo

    ezgif com-crop

    opened by matteogabella 23
  • Support for no-resize and no new crop?

    Support for no-resize and no new crop?

    Firstly, great stuff on this project - really useful and simple!

    My personal use-case is to have a predefined crop size, and then have moving that around be the only option for the user (ie. no resizing of the crop area, and no dragging to create a new crop area).

    I had to fork the repo to implement this functionality, but wondering if that's something you'd be interested in for this repo? If so I can PR those changes in.

    Thanks - love your work!

    opened by BrockWills 23
  • Aspect ratio in Chrome throws console errors

    Aspect ratio in Chrome throws console errors

    I'm using the latest (1.0.0-rc3) version of react-image-crop with the following crop attributes:

    const cropAttributes = {
      width: 100,
      height: 12,
      x: 0,
      y: 0,
      aspect: 1663/200
    }
    

    and I'm receiving the following error in the Chrome console: Error: <polygon> attribute points: Expected number, "0 0, 1 0, 1 NaN, 0 NaN".

    Interestingly enough, this error has no effect on the crop. Everything works as expected, the aspect ratio is locked, the height, width, and coordinates are also correct, even with different values.

    It seems that the inclusion of aspect in the attributes is the only thing that causes this error. Also, if the aspect is the only attribute specified, no error occurs:

    const cropAttributes = {
      aspect: 1663/200
    }
    

    I suspect this might be an issue with webkit but I'm not 100% certain.

    opened by CanadaJ 21
  • V7.0.0 crop in pixel

    V7.0.0 crop in pixel

    Hi!

    I'm just testing the new version of react-image-crop and I think there is a issue with the coords/size of crop. In the previous version I was using pixelCrop from onComplete to get the real coords/size of selection (regardless resize due to CSS). But in the new version the crop coords/size seems to be relative to a scale due to resize. This make incompatible pixelCrop from te previous version and crop of the new one. Also, the old pixelCrop is not available.

    In my opinion, we should always return the real crop size, regardless a resize from the browser.

    opened by Dallas62 18
  • React.createElement: type is invalid

    React.createElement: type is invalid

    Hi! Thank you for creating this plugin! I'm currently trying to implement it in my project, but I keep getting the following error: warning.js:33 Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in. Check the render method ofAddEditLinkModal.

    Perhaps I'm implementing it the wrong way? I'm using webpack for my assets. I've put "react-image-crop" inside my "vendor" entry.

    Inside my react component I've done the following import: import ReactCrop from "react-image-crop"; And the logic I created:

    public state: State = {
    	crop: {
    		x: 0,
    		y: 0,
    		aspect: 10 / 4,
    		width: 50,
    	},
    };
    constructor(props: Props, state: State) {
    	super(props, state);
    
    	this.onCropImageChange = this.onCropImageChange.bind(this);
    }
    
    public handleImgSelection(e: any) {
    	e.preventDefault();
    	const {setImg} = this.props;
    
    	const reader = new FileReader();
    	const file = e.target.files[0];
    
    	reader.onloadend = () => {
    		setImg(file, reader.result);
    	};
    
    	reader.readAsDataURL(file);
    }
    
    public onCropImageChange(crop: State["crop"]) {
    	this.setState({crop: crop});
    }
    

    Inside my render I'm rendering the following ReactCrop: <ReactCrop crop={this.state.crop} src={imgPreview} onChange={this.onCropImageChange} />

    The imgPreview is the reader.result which is saved to my redux store.

    opened by otakueadwine 18
  • Exif orientation/rotation is being ignored

    Exif orientation/rotation is being ignored

    If the image is rotated or flipped via Exif data, this information is not taken care of. As a result, the image is not shown properly in the cropper.

    Example images: https://github.com/recurser/exif-orientation-examples

    opened by raphaelbeckmann 17
  • No default export found in module  import/default

    No default export found in module import/default

    Hey @DominicTobias this lib looks great & really want to use it, but when i try to import it into my components i'm getting this error

    error No default export found in module import/default

    screen shot 2018-06-01 at 2 18 28 pm

    any advice would be appreciated thanks.

    opened by nypinstripes 17
  • Compatibility with react-modal on iOS

    Compatibility with react-modal on iOS

    I couldn't find any previous discussion on this, so I will start one here.

    Our use case involves adding ReactCrop inside a react-modal and we noticed that ReactCrop does not work properly on iOS when placed inside a modal. Basically, the crop rectangle disappears.

    I'm not sure what could be causing this, but my guess is that on iOS Safari the getElementOffset code works unexpectedly because of the way the modal is positioned? I'm going to try to debug this further tomorrow.

    I've modified the demo to include a modal for debugging purposes: https://github.com/Camversity/react-image-crop/tree/debug-modal

    Any thoughts on this?

    opened by tudorpavel 15
  • Working with Javascript-image-load

    Working with Javascript-image-load

    Hi,

    as many others using this library, I also have issues with cropping mobile images that have orientation metadata. I understand that this is not an issue specifically of this library, however it's kind of hard to work with the cropper in the current state, and I would like to ask if the library can help in my scenario.

    Using the library javascript-load-image, I can successfully obtain a CanvasHTMLElement with the image rotated in the proper orientation. However I still have the issue, later on, to use the content of the canvas with react-image-crop in order to show the cropper to the user.

    So far I have been calling canvas.toDataURL() and using the result as the src prop for the cropper.

    However this is quite slow and inefficient, since we already have a canvas element loaded with the proper image, and we are reconverting it to a URL so that the cropper can reload it once again into another img.

    Would it be possible for the cropper to receive as prop the canvas element in the first place, and visualize the cropper layer on top of it?

    opened by MastroLindus 15
  • 4.0.2 Dist Build Is Broken as result of latest ES6 build changes

    4.0.2 Dist Build Is Broken as result of latest ES6 build changes

    The changes for the ES6 build no longer work when including ReactImageCrop statically

    <Removing bad copy/paste ... see below>

    Last working build 4.0.1

    opened by virgofx 15
  • Crop size is larger in dimensions than original image

    Crop size is larger in dimensions than original image

    I believe this is due to the borders of crop selection but the cropped image exceeds the dimensions of the natural image which can cause black / white pixels around the cropped image.

    I don't want to limit the max dimensions as this might produce inaccurate cropped image.

    What's the work around for this?

    https://user-images.githubusercontent.com/8109619/206909871-09fdf05d-1642-4d2f-b58a-f3e52975172f.mov

    opened by sadikyalcin 0
  • Post-crop tiny image top left inside larger black space?

    Post-crop tiny image top left inside larger black space?

    Hi, this is new, and seems to be an edge case of some sort (it's happened only twice that we've seen, and both recently, after using this library for a few years), but there is a situation where users crop an image, and then the image is super tiny in the top left of an otherwise black canvas.

    https://d3k9p5zq72yv95.cloudfront.net/users/user/dDn7EL4_TnahHFov2_fqxA.jpeg

    What the user cropped for their profile photo was what was ultimately in the top left of this canvas. I have a Clarity recording of the user's session, and can see they did nothing out of the ordinary, and the user saw a full crop of the image they selected, as was expected, but what was saved is the image you see linked above.

    We are using 8.6.5.

    This user was on iOS Safari:

    {"os": "iOS", "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6,2 Mobile/15E148 Safari/604.1", "model": "iPhone", "vendor": "Apple", "isMobile": true, "osVersion": "15.7"}

    Thanks!

    Mike

    dDn7EL4_TnahHFov2_fqxA-1

    opened by mikemarian 0
  • How to get cropped image from canvas and set it as file input value in form to submit to backend?

    How to get cropped image from canvas and set it as file input value in form to submit to backend?

    How do I get the cropped image from canvas, and set it as file input value in form to submit to backend?

    here is my useEffect for the ref:

      /*
        |--------------------------------------------------------------------------
        | Use Effect 2
        |--------------------------------------------------------------------------
        */
        useEffect(() => {
    
            if(bigPreviewCanvasRef.current) {
    
                bigPreviewCanvasRef.current.toBlob(
                    (blob) => {
    
                        const newImage = new File([blob], blob.name, {type: blob.type,});
    
                        console.log('bigPreviewCanvasRef.current > newImage: ' + JSON.stringify(newImage, null, 2));
    
                    },
                    'image/jpg',
                    1
                )
    
            }
    
        }, [completedCrop]);
        ```
    
    but it returns `bigPreviewCanvasRef.current > newImage: {}` EMPTY in console log everytime
    opened by yelnyafacee 0
  • Getting cropped image results from canvas elements

    Getting cropped image results from canvas elements

    I am currently trying to obtain a cropped image from a canvas element. I have tried to update the code to work with a canvas instead of the standard img I have seen in examples, but so far its just outputting a blank image for the result. Any help on how to correctly implement this functionality would be much appreciated. Thanks.

    CodeSandbox example

    opened by JohnnyRacer 0
  • Document should point to `componentRef.current.ownerDocument`

    Document should point to `componentRef.current.ownerDocument`

    Currently getter of document on ReactCrop simply returns document. And it is probably correct for 99,9% of use cases.

    In my use case, however - I render crop tool into another window, from source window, via React portal. This means - source window runs the javascript, while crop lives in another window.

    As a result - it simply doesnt work.

    I did apply some workaround locally:

    Reflect.defineProperty(ReactCrop.prototype, "document", {
      get() {
        // get document that 'owns' HTML instance of crop DOM element
        return (this as ReactCrop).componentRef.current?.ownerDocument ?? document;
      },
    });
    

    that solved the issue

    opened by pie6k 3
Releases(10.0.9)
  • 10.0.9(Nov 28, 2022)

  • 10.0.8(Oct 7, 2022)

  • 10.0.7(Sep 8, 2022)

    • Infer correct output type (PixelCrop or PercentCrop) depending on input in makeAspectCrop and centerCrop (thanks: @corymharper)
    • Fix minWidth/minHeight for aspect crops when one or the other wasn't specified
    Source code(tar.gz)
    Source code(zip)
  • 10.0.6(Aug 15, 2022)

  • 10.0.5(Jul 30, 2022)

  • 10.0.4(Jun 14, 2022)

  • 10.0.3(Jun 13, 2022)

    • Fix #491 (Tabbing to a drag handle which is on the edge can cause the crop media (e.g. image) to scroll slightly in the container - since the browser tries to make things which are tabbed to entirely visible)
    Source code(tar.gz)
    Source code(zip)
  • 10.0.2(Jun 5, 2022)

    No changes just a fix for SSR that was regressed in 10.0.1.

    Trying to assign document to a variable on load caused issues with some SSR setups (e.g. NextJS). Now document is by default as a function that is evaluated during render to fix this.

    If you wish to override document you can choose to keep it a function so that it works better with SSR:

    class IframeReactCrop extends ReactCrop {
      get document() {
        return window.top.document
      }
    }
    
    Source code(tar.gz)
    Source code(zip)
  • 10.0.1(May 11, 2022)

    • No change other than the ability to override document when using ReactCrop in an iframe. Fixes #482
    class IframeReactCrop extends ReactCrop {
      constructor(props: ReactCropProps) {
        super(props)
        this.document = window.top.document
      }
    }
    
    Source code(tar.gz)
    Source code(zip)
  • 10.0.0(Mar 20, 2022)

  • 10.0.0-beta.5(Mar 13, 2022)

  • 10.0.0-beta.4(Mar 7, 2022)

  • 10.0.0-beta.3(Mar 6, 2022)

  • 10.0.0-beta.2(Mar 4, 2022)

    • When setting an initial crop there was a possible race condition that would mean that the initial onComplete before user input might not get called
    Source code(tar.gz)
    Source code(zip)
  • 10.0.0-beta.1(Mar 2, 2022)

    Some minor fixes:

    • makeAspectCrop returns a crop of the passed in unit
    • onComplete is fired when going from no crop to a crop, this makes it easier to show a crop preview when making an initial crop without user input
    Source code(tar.gz)
    Source code(zip)
  • 10.0.0-beta.0(Mar 1, 2022)

    ⚠️ Breaking changes for all users

    Over the years this library had become hard to maintain. This release inverts some control to the user (breaking changes for all) which reduces the amount of props needed.

    This release contains extensive refactoring (hence beta status for now). All functionality is still possible except for two rarely used props.

    ❌ Removed props (but still possible, read more below):

    • crossorigin
    • imageAlt
    • onImageError
    • onImageLoaded
    • renderComponent
    • rotate
    • scale

    These rarely used props are completely removed as they were buggy but too complex for me to maintain. If you still want them then use v9:

    • zoom 💀
    • spin 💀

    ✅ Added props

    Since there is no longer such a thing as a partial/incomplete crop (you must ALWAYS pass in a crop with all props (unit, x, y, width, height or NOT AT ALL) it made sense to move aspect out into a prop, so that to start with no crop you simply omit the crop prop or pass undefined:

    • aspect (was previously inside the crop object)

    So what does it look like?

    It's up to you to now render whatever you want as children of ReactCrop:

    const [crop, setCrop] = useState<Crop>()
    return (
      <ReactCrop crop={crop} aspect={16 / 9} onChange={c => setCrop(c)}>
        <img src={src} />
      </ReactCrop>
    )
    

    See advanced demo on CodeSandbox

    All those removed props mentioned before e.g. crossorigin and imageAlt can be added by you:

    <ReactCrop crop={crop} aspect={16 / 9} onChange={c => setCrop(c)}>
      <img src={src} crossorigin="anonymous" alt="Crop this image" />
    </ReactCrop>
    

    Even rotate and scale are just CSS properties:

    <img src={src} crossorigin="anonymous" alt="Crop this image" style={{ transform: `scale(${scale}) rotate(${rotate}deg)` }} />
    

    As mentioned you either have a crop or not. ⚠️ Don't pass in a crop that doesn't have a width for example (unlike before). Since making aspect crops with percentages is a little tricky you can use the makeAspectCrop(crop: Partial<Crop>, aspect: number, containerWidth: number, containerHeight: number) helper. For example to start with a centered landscape crop:

    import ReactCrop, { Crop, centerCrop, makeAspectCrop } from 'react-image-crop'
    
    const [crop, setCrop] = useState<Crop>()
    
    function onImageLoad(e) {
      const { width, height } = e.currentTarget
    
      const crop = centerCrop(
        makeAspectCrop(
          {
            // You don't need to pass a complete crop into
            // makeAspectCrop or centerCrop
            unit: '%',
            width: 90,
          },
          16 / 9,
          width,
          height
        ),
        width,
        height
      )
    
      this.setState({ crop })
    }
    
    return (
      <ReactCrop crop={crop} aspect={16 / 9} onChange={c => setCrop(c)}>
        <img src={src} onLoad={onImageLoad} />
      </ReactCrop>
    )
    
    Source code(tar.gz)
    Source code(zip)
  • 9.1.1(Feb 4, 2022)

  • 9.1.0(Feb 4, 2022)

    • Add keyboard support for resizing the crop (thanks to @ccveer )

    https://user-images.githubusercontent.com/760314/152597684-ac530422-3573-43bf-95be-c74ca2fe7073.mov

    • Internal: significant re-write of some crop containment logic. While there shouldn't be breaking changes proceed with caution.
    Source code(tar.gz)
    Source code(zip)
  • 9.0.8(Feb 1, 2022)

    • One more adjustment to crop containing logic so that the crop cannot get nudged from it's position when resizing and hitting a boundary very fast. Hopefully the containment logic is finally perfect in all scenarios.
    Source code(tar.gz)
    Source code(zip)
  • 9.0.7(Feb 1, 2022)

  • 9.0.6(Feb 1, 2022)

    • Refactor logic to keep aspect crops in bounds to fix buggy behaviour when resizing: SW against bottom bound, NW handle against left bound, NE handle against right bound
    Source code(tar.gz)
    Source code(zip)
  • 9.0.5(Nov 9, 2021)

  • 9.0.4(Sep 6, 2021)

  • 9.0.3(Aug 26, 2021)

    • Add spin prop. A non-visual prop to keep pointer coords accurate when a parent element is rotated. Not to be confused with the rotate prop which rotates the image itself. Defaults to 0, range is from -180 to 180. This behaviour is typically found in an image editing app when rotating both the image and the crop. #436
    Source code(tar.gz)
    Source code(zip)
  • 9.0.2(Aug 20, 2021)

  • 9.0.1(Aug 20, 2021)

  • 9.0.0(Aug 20, 2021)

    Note that you should use 9.0.2 (9.0.0 + 9.0.1 are deprecated due to some issues)

    The library is now written in Typescript and comes with two breaking changes:

    1. You should remove @types/react-image-crop as the library is now self-documenting.
    2. If you were importing the .scss file, the path is now src/ReactCrop.scss instead of lib/ReactCrop.scss.

    There are also two new props:

    • scale: For zooming the image in and out. Defaults to 1. Combine with react-zoom-pan-pinch if you want pinch and scroll zooming.
    • rotate: For rotating the image between -180 to 180. Defaults to 0.

    scale-rotate

    Source code(tar.gz)
    Source code(zip)
  • 8.6.12(Jun 16, 2021)

  • 8.6.10(Jun 14, 2021)

    ⚠️ Edit: This is a breaking change for some SASS users of ReactCrop.scss ⚠️ Apologies this should have been a breaking change. ReactCrop.scss is now compatible with https://www.npmjs.com/package/sass only, not with the deprecated packages node-sass or dart-sass which was done in the process of fixing deprecation warnings for #426 Alternatively if you aren't changing any SCSS variables you can import ReactCrop.css instead.

    • Fixed "Minimum height/width not respected on mobile if user "taps" the image" #425
    • Fixed deprecation warning when using new sass library #426
    • Fixed scrolling window when dragging to move/resize crop on touch.
    • Some internal changes to simplify/reduce some code.
    • Removed support for proprietary IE .setActive function instead of .focus (IE support was dropped and not working properly for a while anyway).
    • Switch to using pointer events instead of touch + mouse.
    Source code(tar.gz)
    Source code(zip)
  • 8.6.9(Apr 26, 2021)

Owner
Interested in programming and fintech: JS, UI, WASM, C++, Rust, Go, V, blockchain, dapps, trading
null
Jcrop - The Javascript Image Cropping Engine

Jcrop Image Cropping Plugin Jcrop is the quick and easy way to add image cropping functionality to your web application. It combines the ease-of-use o

Kelly Hallman 4.3k Dec 20, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Simple Cropper is a jQuery plugin which gives you ability to add cropping functionality to your web application

Simple Cropper is a jQuery plugin which gives you ability to add cropping functionality to your web application. It uses html5 canvas to create cropped images and css3, so it only works on latest browsers.

null 1 Feb 15, 2022
optimize image & upload file to cloud as image bed with tiny image automic.

Rush! 图片压缩 & 直传图床工具 这是一个兴趣使然的项目, 希望 Rush! 能让这个世界的网络资源浪费减少一点点 下载 Downloads 获取最新发行版 功能 Features 拖拽批量压缩图片, 支持格式 jpg/png/gif Drop to optimize, jpg/png/gif

{ Chao } 3 Nov 12, 2022
Responsive Tabs is a jQuery plugin that provides responsive tab functionality.

Responsive Tabs is a jQuery plugin that provides responsive tab functionality. The tabs transform to an accordion when it reaches a CSS breakpoint. You can use this plugin as a solution for displaying tabs elegantly on desktop, tablet and mobile.

Jelle Kralt 537 Dec 8, 2022
Freewall is a cross-browser and responsive jQuery plugin to help you create grid, image and masonry layouts for desktop, mobile, and tablet...

Freewall Freewall is a cross-browser and responsive jQuery plugin to help you create many types of grid layouts: flexible layouts, images layouts, nes

Minh Nguyen 1.9k Dec 27, 2022
Display an image in a responsive imagebox without jQuery.

Documentation ImageBox latest version 1.3.0 Include this files: <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/tobiasroeder/[email protected]/d

Tobias Röder 5 Aug 31, 2021
🖼️ Image proxy for Next.js. Makes it possible to use dynamic domains in next/image component.

Next.js Image Proxy Image proxy for Next.js. Makes it possible to use dynamic domains in next/image component. ❔ Motivation This library makes it poss

Blazity 30 Dec 1, 2022
A Javascript library that discourages and prevents image theft/download by preventing client ability to retrieve the image.

ProtectImage.js ProtectImage.js is a Javascript library that helps prevent image theft by disabling traditional user interactions to download/copy ima

null 4 Aug 18, 2022
Simple JavaScript Library to add parallax image to background-image

Backpax Simple JavaScript Library to add parallax image to background-image Install $ npm install backpax --save Demo Demo page is here Usage If you

appleple 13 Oct 12, 2022
Piccloud is a full-stack (Angular & Spring Boot) online image clipboard that lets you share images over the internet by generating a unique URL. Others can access the image via this URL.

Piccloud Piccloud is a full-stack application built with Angular & Spring Boot. It is an online image clipboard that lets you share images over the in

Olayinka Atobiloye 3 Dec 15, 2022
Hashmat Noorani 4 Mar 21, 2023
A refined tool for exploring open-source projects on GitHub with a file tree, rich Markdown and image previews, multi-pane multi-tab layouts and first-class support for Ink syntax highlighting.

Ink codebase browser, "Kin" ?? The Ink codebase browser is a tool to explore open-source code on GitHub, especially my side projects written in the In

Linus Lee 20 Oct 30, 2022
Invertio - An Awesome Image Colour Inverter Tool

Invertio What Is Invertio? Invertio Is A Tool To Invert The Colours In Your Imag

Sancho Godinho 1 Feb 10, 2022
A fully responsive React app that allows you to search for movies from Movie Database.

A fully responsive React app that allows you to search for movies from Movie Database (IMDB Alternative).

Tushar Indurjeeth 3 Jul 16, 2022
A CLI tool to create a NodeJS project with TypeScript CTSP is a CLI tool to make easier to start a new NodeJS project and configure Typescript on it.

CTSP- Create TS Project A CLI tool to create a NodeJS project with TypeScript CTSP is a CLI tool to make easier to start a new NodeJS project and conf

Jean Rodríguez 7 Sep 13, 2022