image-editorjs

1.0.4 • Public • Published

Image Plugin for EditorJs

Enable your EditorJS to embed an image.

Credits

Created with ❤ by Muhammad Affandes

Installation

With package manager NPM or Yarn

Run following command to install plugins.

npm install image-editorjs

Or

yarn add image-editorjs

Load via CDN

Place following line at the end of your HTML body tag.

...
<script src="https://cdn.jsdelivr.net/npm/image-editorjs"></script>
...

Usage

Insert following snippets to your EditorJs configuration object.

import EditorJS from "@editorjs/editorjs";
import ImageEditor from "./katex-editor"
 
// Your EditorJs init
const editorjs = new EditorJS({
    // ...
    tools: {
        image: {
            class: ImageEditor
        },
    },
    // ...
});
 

Config Params

Params Description
placeholder String. (Optional) Your placeholder

Output Data

Image will be wrapped with div tag with .aff-image-wrapper class.

{
    "type": "image",
    "data": {
        "url": "https://domain.com/images/file/url.jpg",
        "caption": "Your caption here..."
    }
}

Package Sidebar

Install

npm i image-editorjs

Weekly Downloads

0

Version

1.0.4

License

MIT

Unpacked Size

147 kB

Total Files

4

Last publish

Collaborators

  • affandes