0.2.2 • Published 10 months ago

react-img-editor v0.2.2

Weekly downloads
37
License
MIT
Repository
github
Last release
10 months ago

react-img-editor · 图像编辑器

npm.io npm.io

react-img-editor 是一个图像编辑器 react 组件,支持对图片进行裁剪、涂鸦、文字编辑、马赛克处理等操作,同时支持自定义插件和灵活的样式配置。

示例

查看 demo

✨ 特性

  • 支持自由画笔、矩形、圆形、箭头、文字、马赛克的绘制
  • 支持橡皮擦、撤销操作、截图和图片下载
  • 支持自定义插件和工具栏配置
  • 支持矩形、圆形、箭头、文字等节点的拉伸、拖拽和删除
  • 支持同一页面多个组件同时存在

📦 下载

npm install react-img-editor -S

🔨 引入和使用

import ReactImgEditor from 'react-img-editor'
import 'react-img-editor/assets/index.css'

<ReactImgEditor src="https://www.w3schools.com/html/img_girl.jpg" />

🧰 API

属性描述类型默认值
src图片 urlstring-
width画板宽度number?700
height画板高度number?500
style画板样式React.CSSProperties-
plugins自定义的插件Plugin[][]
toolbar工具栏配置{ items: string[] }{items: ['pen', 'eraser', 'arrow', 'rect', 'circle', 'mosaic', 'text', '', 'repeal', 'download', 'crop']}
getStage获取 KonvaJS 的 Stage 对象,可用于下载图片等操作(stage: any) => void
defaultPluginName默认选中的插件名称string?-
crossOrigin处理跨域图片string?-

📝 TODO

  • 动态加载图片
  • 下载图片类型配置
  • 提供插件配置项配置
  • 优化自由画笔书写体验
  • 国际化支持

🤝 贡献

开发

npm run start

http://127.0.0.1:8012/examples/simple.html

发布

npm run lint
npm run pub
0.2.2

10 months ago

0.2.1

3 years ago

0.2.0

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.15

4 years ago

0.0.14

4 years ago

0.0.12

4 years ago

0.0.13

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.3

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago