@maitrakhatri/editorjs-simple-image
v1.1.1
Published
SimpleImage Tool for Editor.js
Downloads
98
Maintainers
Readme
Simple Image Tool (without Caption)
Provides Image Blocks (without Caption) for the Editor.js.
Works for Image drag n drop, pasting images from clipboard and requires no server-side uploader.
Installation
Install via NPM
Get the package
npm i @maitrakhatri/editorjs-simple-image
Include module at your application
const SimpleImage = require('@maitrakhatri/editorjs-simple-image');
OR
import SimpleImage from "@maitrakhatri/editorjs-simple-image";
Download to your project's source dir
- Upload folder
dist
from repository - Add
dist/bundle.js
file to your page.
Usage
Add a new Tool to the tools
property of the Editor.js initial config.
var editor = EditorJS({
...
tools: {
...
image: SimpleImage,
}
...
});
Config Params
This Tool has no config params
Tool's settings
Add border
Stretch to full-width
Add background
Output data
| Field | Type | Description |
| -------------- | --------- | ------------------------------- |
| url | string
| image's url |
| withBorder | boolean
| add border to image |
| withBackground | boolean
| need to add background |
| stretched | boolean
| stretch image to screen's width |
{
"type" : "image",
"data" : {
"url" : "https://www.tesla.com/tesla_theme/assets/img/_vehicle_redesign/roadster_and_semi/roadster/hero.jpg",
"withBorder" : false,
"withBackground" : false,
"stretched" : true
}
}