Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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)