@lokeshpahal/editorjs-button-link

1.0.5 • Public • Published

Set Link and Text and Generate button plugin for Editor.js

How to use

  1. Install
yarn add @lokeshpahal/editorjs-button-link
  1. Connect

Add a new Tool to the tools property of the Editor.js initial config.

tools: {
        ButtonLink: {
          class: ButtonLink,
          inlineToolbar: false,
          config:{
            css:{
              "btnColor": "btn--gray",
            }
          }
        },
      },
      i18n: {
        messages: {
          tools: {
            "ButtonLink": {
              'Button Text': 'My Button',
              'Link Url': 'https://lokeshpahal.com',
              'Set': "To set",
              'Default Button': "Default",
            }
          }
        },
      },
}

Config Params

i18n overwrite if want to change default placeholder text,

i18n: {
    messages: {
      tools: {s
        "ButtonLink": {
          'Button Text': 'My Button',
          'Link Url': 'https://lokeshpahal.com',
          'Set': "To set",
          'Default Button': "Default",
        }
      }
    },
},

if customize css, input filed, button design, and etc...

config:{
    css:{
      "btnColor": "btn--gray",
    }
}

Output data

Field Type Description
link string Exclusion HTML Tag text
text string Exclusion HTML Tag text
{
            "type" : "ButtonLink",
            "data" : {
                "link" : "https://editorjs.io/",
                "text" : "editorjs official"
            }
        }

Package Sidebar

Install

npm i @lokeshpahal/editorjs-button-link

Weekly Downloads

2

Version

1.0.5

License

MIT

Unpacked Size

340 kB

Total Files

11

Last publish

Collaborators

  • lokeshpahal