# @cropper/element-canvas

> A custom canvas element for the Cropper.

Latest version **2.2.0** (published 2026-08-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install @cropper/element-canvas
pnpm add @cropper/element-canvas
yarn add @cropper/element-canvas
bun add @cropper/element-canvas
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; popular repo.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.2.0 |
| Published | 2026-08-23 |
| First published | 2022-05-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 134.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 13898 |
| Author | Chen Fengyuan |
| Maintainers | chenfengyuan |
| Keywords | canvas, cropper, cropper.js, cropper-element, custom-element, web-component |

## Links

- npm: https://www.npmjs.com/package/@cropper/element-canvas
- Repository: https://github.com/fengyuanchen/cropperjs
- Homepage: https://github.com/fengyuanchen/cropperjs/tree/main/packages/element-canvas/#readme
- Issues: https://github.com/fengyuanchen/cropperjs/issues
- npm.io page: https://npm.io/package/@cropper/element-canvas

## Dependencies (2)

- [@cropper/utils](https://npm.io/package/@cropper/utils.md) ^2.2.0
- [@cropper/element](https://npm.io/package/@cropper/element.md) ^2.2.0

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 2.2.0 (latest) — 2026-08-23
- 2.0.0-rc.2 (next) — 2024-08-18
- 2.1.1 — 2026-04-06
- 2.1.0 — 2025-10-19
- 2.0.1 — 2025-07-25
- 2.0.0 — 2025-03-01
- 2.0.0-rc.1 — 2024-07-06
- 2.0.0-rc.0 — 2024-06-22
- 2.0.0-rc — 2024-05-26
- 2.0.0-beta.5 — 2024-04-21
- 2.0.0-beta.4 — 2023-08-20
- 2.0.0-beta.3 — 2023-06-18
- 2.0.0-beta.2 — 2022-12-04
- 2.0.0-beta.1 — 2022-06-19
- 2.0.0-beta — 2022-05-01

## README

# @cropper/element-canvas

> A custom canvas element for the Cropper.

## Main npm package files

```text
dist/
├── element-canvas.js         (UMD, bundled)
├── element-canvas.min.js     (UMD, bundled, compressed)
├── element-canvas.raw.js     (UMD, unbundled, default)
├── element-canvas.esm.js     (ECMAScript Module, bundled)
├── element-canvas.esm.min.js (ECMAScript Module, bundled, compressed)
├── element-canvas.esm.raw.js (ECMAScript Module, unbundled)
└── element-canvas.d.ts       (TypeScript Declaration File)
```

## Getting started

### Installation

```sh
npm install @cropper/element-canvas
```

### Usage

```js
import CropperCanvas from '@cropper/element-canvas';

CropperCanvas.$define();
```

```html
<cropper-canvas></cropper-canvas>
```

## Versioning

Maintained under the [Semantic Versioning guidelines](https://semver.org).

## License

[MIT](https://opensource.org/licenses/MIT)

---
_Source: https://npm.io/package/@cropper/element-canvas · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
