@lokeshpahal/alert-variant-tune

1.0.3 • Public • Published

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'],
    }
  },
})

Readme

Keywords

Package Sidebar

Install

npm i @lokeshpahal/alert-variant-tune

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

158 kB

Total Files

24

Last publish

Collaborators

  • lokeshpahal