Header Tool for CodeX.Editor
npm install codex.editor.header
Provides Headings Blocks for the CodeX Editor.
Get the package
``shell`
npm i --save-dev codex.editor.header
Include module at your application
`javascript`
const Header = require('codex.editor.header');
1. Upload folder dist from repositorydist/bundle.js
2. Add file to your page.
https://cdn.jsdelivr.net/npm/codex.editor.header@2.0.4
Then require this script on page with CodeX Editor.
`html`
Add a new Tool to the tools property of the CodeX Editor initial config.
`javascript`
var editor = CodexEditor({
...
tools: {
...
header: Header,
},
...
});
You can insert this Block by a useful shortcut. Set it up with the tools[].shortcut property of the Editor's initial config.
`javascript`
var editor = CodexEditor({
...
tools: {
...
header: {
class: Header,
shortcut: 'CMD+SHIFT+H',
},
},
...
});
| Field | Type | Description |
| ----------- | -------- | --------------------------- |
| placeholder | string | header's placeholder string |
`javascript`
var editor = CodexEditor({
...
tools: {
...
header: {
class: Header,
config: {
placeholder: 'Enter a header'
}
}
}
...
});

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