1.0.12 • Published 1 year ago
editorjs-text-alignment-tool v1.0.12
Text Alignment tune tool for Editor.js
You can add text alignment to any block.
If you can help, please push the Star button :)
required
- editor.js v2.22.3 ↑
Installation
Install via NPM
Get the package
npm i --save editorjs-text-alignment-tool
Include module at your application
const TextAlignmentTool = require('editorjs-text-alignment-tool');
Download to your project's source dir
- Upload folder
dist
from repository - Add
dist/bundle.js
file to your page.
Load from CDN
https://cdn.jsdelivr.net/npm/editorjs-text-alignment-tool@latest
usage
and look editor.js document
tool:{
list: {
class: List,
inlineToolbar: true,
},
header: {
class: Header,
tunes: ['textAlignment'],
},
paragraph: {
class: Paragraph,
inlineToolbar: false,
tunes: ['textAlignment'],
},
textAlignment: {
class:AlignmentTuneTool,
config:{
default: "right",
blocks: {
header: 'center',
list: 'right'
}
},
}
}
Config Params
Field | Type | Description |
---|---|---|
default | string | "left"/"center"/"right"/"justify", If not set, it will be "left". |
blocks | object | Default alignment can be set for each block |