
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
@editorjs/list
Advanced tools
lower-roman
).Use Tab
and Shift+Tab
keys to create or remove sublist with a padding.
Get the package
yarn add @editorjs/list
Include module at your application
import EditorjsList from '@editorjs/list';
Optionally, you can load this tool from CDN JsDelivr CDN
Add the List Tool to the tools
property of the Editor.js initial config.
import EditorJS from '@editorjs/editorjs';
import EditorjsList from '@editorjs/list';
var editor = EditorJS({
// ...
tools: {
...
list: {
class: EditorjsList,
inlineToolbar: true,
config: {
defaultStyle: 'unordered'
},
},
},
});
[!IMPORTANT] Note that in List 2.0 class name changed from
List
toEditorjsList
.
Field | Type | Description |
---|---|---|
defaultStyle | string | default list style: ordered , unordered or checklist , default is unordered |
maxLevel | number | maximum level of the list nesting, could be set to 1 to disable nesting, unlimited by default |
counterTypes | string[] | specifies which counter types should be shown in the ordered list style, could be set to ['numeric','upper-roman'] , default is undefined which shows all counter types |
Field | Type | Description |
---|---|---|
style | string | list will be rendered with this style: ordered , unordered or checklist , default is defaultStyle from tool config |
meta | ItemMeta | Item meta based on the list style |
items | Item[] | the array of list's items |
Object Item
:
Field | Type | Description |
---|---|---|
content | string | item's string content |
meta | ItemMeta | meta information about item |
items | Item[] | the array of list's items |
Object ItemMeta
for Checklist:
Field | Type | Description |
---|---|---|
checked | boolean | state of the checkbox |
Object ItemMeta
for Ordered list
Field | Type | Description |
---|---|---|
start | number | number for list to start with, default is 1 |
counterType | string | counter type for list, it could be numeric , lower-roman , upper-roman , lower-alpha , upper-alpha , default is numeric |
Object ItemMeta
for Unordered list would be empty.
If you want to use your language for toolbox items, you can pass i18n dictionary to the editorjs instance below the tools block
:
i18n: {
messages: {
"toolNames": {
"Ordered List": "Nummerierte Liste",
"Unordered List": "Unnummeriert Liste",
"Checklist": "Checkliste",
},
"tools": {
"List": {
'Unordered': 'Unnummeriert',
'Ordered': 'Nummerierte',
'Checklist': 'Checkliste',
}
},
},
},
tools.List
Start with
Counter type
Numeric
Lower Roman
Upper Roman
Lower Alpha
Upper Alpha
Unordered List
{
"type" : "list",
"data" : {
"style": "unordered",
"items": [
{
"content": "Apples",
"meta": {},
"items": [
{
"content": "Red",
"meta": {},
"items": []
},
]
},
]
}
},
Ordered List
{
"type" : "list",
"data" : {
"style": "ordered",
"meta": {
"start": 2,
"counterType": "upper-roman",
},
"items" : [
{
"content": "Apples",
"meta": {},
"items": [
{
"content": "Red",
"meta": {},
"items": []
},
]
},
]
}
},
Checklist
{
"type" : "list",
"data" : {
"style": "checklist",
"items" : [
{
"content": "Apples",
"meta": {
"checked": false
},
"items": [
{
"content": "Red",
"meta": {
"checked": true
},
"items": []
},
]
},
]
}
},
FAQs
List Tool for EditorJS
The npm package @editorjs/list receives a total of 55,096 weekly downloads. As such, @editorjs/list popularity was classified as popular.
We found that @editorjs/list demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.