Nested list Tool for EditorJS
npm install @demoflow/nested-list
Multi-leveled lists for the Editor.js.
Use Tab and Shift+Tab keys to create or remove sublist with a padding.

Get the package
``shell`
npm i --save @editorjs/nested-list
Or
`shell`
yarn add @editorjs/nested-list
Include module at your application
`javascript`
import NestedList from "@editorjs/nested-list";
Load the script from jsDelivr CDN and connect to your page.
`html`
Add the NestedList Tool to the tools property of the Editor.js initial config.
`javascript
import EditorJS from '@editorjs/editorjs';
import NestedList from '@editorjs/nested-list';
var editor = EditorJS({
// ...
tools: {
...
list: {
class: NestedList,
inlineToolbar: true,
},
},
});
`
| Field | Type | Description |
| ---------------- | -------- | ---------------------------------------------- |
| defaultListStyle | string | type of default list: ordered or unordered |

You can choose lists type.
| Field | Type | Description |
| ----- | -------- | ---------------------------------------- |
| style | string | type of a list: ordered or unordered |
| items | Item[] | the array of list's items |
Object Item:
| Field | Type | Description |
| ------- | -------- | ------------------------- |
| content | string | item's string content |
| items | Item[] | the array of list's items |
``json``
{
"type" : "list",
"data" : {
"style" : "unordered",
"items" : [
{
"content": "Apples",
"items": [
{
"content": "Red",
"items": []
},
{
"content": "Green",
"items": []
},
]
},
{
"content": "Bananas",
"items": [
{
"content": "Yellow",
"items": []
},
]
},
]
}
},