Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dehwyy/svelte-cropper
🔎Cropper for Svelte
https://github.com/dehwyy/svelte-cropper
cropperjs svelte sveltekit
Last synced: 7 days ago
JSON representation
🔎Cropper for Svelte
- Host: GitHub
- URL: https://github.com/dehwyy/svelte-cropper
- Owner: dehwyy
- License: mit
- Created: 2024-01-22T14:47:34.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-05-27T12:54:04.000Z (7 months ago)
- Last Synced: 2024-11-03T23:04:25.770Z (about 2 months ago)
- Topics: cropperjs, svelte, sveltekit
- Language: Svelte
- Homepage: https://svelte-cropper.vercel.app
- Size: 95.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `SvelteCropper`
CropperJS component for Svelte.
## Example
```svelte
import { Cropper, type CropperInstance, type CropperDefaultProps } from "svelte-cropper"
let cropper: CropperInstance | null = null
let image_src = "https://svelte-cropper.vercel.app/ok.jpg"
const cropper_props: CropperDefaultProps = {
viewMode: 2, // necessary,
// optional
dragMode: "crop",
initialAspectRatio: 1 // not reactive as cropper initializes on component mount
}
```
[More examples](https://github.com/dehwyy/svelte-cropper/blob/master/src/routes)
## Demo
* [SvelteCropper](https://svelte-cropper.vercel.app/)
* [CropperJS](https://fengyuanchen.github.io/cropperjs/)## Instalation
```shell
pnpm add svelte-cropper
```## Options
* [CropperJS Docs](https://github.com/fengyuanchen/cropperjs#options)