This Tool for the Editor.js allows you to add ordered or unordered (bulleted) lists to your article.
Get the package
npm i --save-dev @editorjs/list
Include module at your application
const List = require('@editorjs/list');
- Upload folder
dist
from repository - Add
dist/bundle.js
file to your page.
You can load specific version of package from jsDelivr CDN.
https://cdn.jsdelivr.net/npm/@editorjs/[email protected]
Then require this script on page with Editor.js.
<script src="..."></script>
Add a new Tool to the tools
property of the Editor.js initial config.
var editor = EditorJS({
...
tools: {
...
list: {
class: List,
inlineToolbar: true,
},
}
...
});
This Tool has no config params
You can choose list`s type.
Field | Type | Description |
---|---|---|
style | string |
type of list: ordered or unordered |
items | string[] |
array of list's items |
{
"type" : "list",
"data" : {
"style" : "unordered",
"items" : [
"This is a block-styled editor",
"Clean output data",
"Simple and powerful API"
]
}
},