You can add text alignment to any block.
If you can help, please push the Star button :)
- editor.js v2.22.3 ↑
Get the package
npm i --save editorjs-text-alignment-blocktune
Include module at your application
const AlignmentTuneTool = require('editorjs-text-alignment-blocktune');
- Upload folder
dist
from repository - Add
dist/bundle.js
file to your page.
https://cdn.jsdelivr.net/npm/editorjs-text-alignment-blocktune@latest
and look editor.js document
tool:{
list: {
class: List,
inlineToolbar: true,
},
header: {
class: Header,
tunes: ['anyTuneName'],
},
paragraph: {
class: Paragraph,
inlineToolbar: false,
tunes: ['anyTuneName'],
},
anyTuneName: {
class:AlignmentTuneTool,
config:{
default: "right",
blocks: {
header: 'center',
list: 'right'
}
},
}
}
Field | Type | Description |
---|---|---|
default | string |
"left"/"center"/"right", If not set, it will be "left". |
blocks | object |
Default alignment can be set for each block |