Skip to content

lokeshpahal/editorjs-text-alert-tune

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text Variant Tune

Editor.js Alert Tune allows applying one of defined text alert variant: Info, Warning, and Danger to any block.

How to use

  1. Install
yarn add @editorjs/text-variant-tune
  1. Connect
import EditorJS from '@editorjs/editorjs';
import AlertVariantTune from 'lokeshpahal/text-alert-tune';

/**
 * Editor.js configuration
 */
const editor = new EditorJS({
  /**
   * Connect tool
   */
  tools: {
    alertVariant: AlertVariantTune
  },

  /**
   * Apply to all the blocks
   */
  tunes: ['alertVariant'],

  // ...
})

Optionally, you can connect this Tune only for specified blocks:

import EditorJS from '@editorjs/editorjs';
import AlertVariantTune from 'lokeshpahal/text-alert-tune';

/**
 * Editor.js configuration
 */
const editor = new EditorJS({
  tools: {
    alertVariant: AlertVariantTune,
    paragraph: { // apply only for the 'paragraph' tool
      tunes: ['alertVariant'],
    }
  },
})

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published