Package Exports
- @editorjs/header
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@editorjs/header) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Header Tool
Provides Headings Blocks for the Editor.js.
Installation
Install via NPM
Get the package
npm i --save-dev @editorjs/headerInclude module at your application
const Header = require('@editorjs/header');Download to your project's source dir
- Upload folder
distfrom repository - Add
dist/bundle.jsfile to your page.
Load from CDN
You can load specific version of package from jsDelivr CDN.
https://cdn.jsdelivr.net/npm/@editorjs/header@2.0.4
Then require this script on page with Editor.js.
<script src="..."></script>Usage
Add a new Tool to the tools property of the Editor.js initial config.
var editor = EditorJS({
...
tools: {
...
header: Header,
},
...
});Shortcut
You can insert this Block by a useful shortcut. Set it up with the tools[].shortcut property of the Editor's initial config.
var editor = EditorJS({
...
tools: {
...
header: {
class: Header,
shortcut: 'CMD+SHIFT+H',
},
},
...
});Config Params
| Field | Type | Description |
|---|---|---|
| placeholder | string |
header's placeholder string |
var editor = EditorJS({
...
tools: {
...
header: {
class: Header,
config: {
placeholder: 'Enter a header'
}
}
}
...
});Tool's settings

You can select one of three levels for heading.
Output data
| Field | Type | Description |
|---|---|---|
| text | string |
header's text |
| level | number |
level of header: 2 for H2, 3 for H3, 4 for H4 |
{
"type" : "header",
"data" : {
"text" : "Why Telegram is the best messenger",
"level" : 2
}
}