Skip to content

GreenBabyBorn/editorjs-align-blocktune

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text Alignment tune tool for Editor.js

You can add text alignment to any block (heading, paragraph).

align

Installation

Install via NPM

Get the package

npm i --save editorjs-align-blocktune

Include module at your application

import AlignmentBlockTune from "editorjs-align-blocktune";

Usage

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: AlignmentBlockTune,
      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

About

Text alignment block tune tool for Editor.js

Resources

Stars

Watchers

Forks

Contributors

Languages

  • JavaScript 95.5%
  • CSS 4.5%