A Svelte component to crop images with easy interactions
The svelte-easy-crop is a Svelte component that allows users to easily crop images with interactive features. It is a rewrite of the react-easy-crop component and is available under the MIT License. This component supports drag and zoom interactions, provides crop dimensions in both pixels and percentages, and can handle images in various formats such as JPEG, PNG, and GIF.
To install svelte-easy-crop, you can follow these steps:
npm install svelte-easy-crop
import Cropper from 'svelte-easy-crop';
<Cropper {image} {crop} {zoom} {aspect} {minZoom} on:cropComplete={handleCrop} />
Make sure to replace {image}
, {crop}
, {zoom}
, {aspect}
, {minZoom}
, and handleCrop
with your desired values and function.
The svelte-easy-crop component is a useful tool for cropping images with ease. It provides drag and zoom interactions, supports various image formats, and is mobile-friendly. With its straightforward installation process and customizable props, it can be seamlessly integrated into Svelte projects.