JSFiddle - React, Tailwind, and code Playground

by Ankit_Kachhadiya

HTML

<link rel="stylesheet" href="https://unpkg.com/grapesjs/dist/css/grapes.min.css">
<script src="https://unpkg.com/grapesjs"></script>
<script src="https://unpkg.com/grapesjs-blocks-basic"></script>
<div id="gjs"></div>

JavaScript

var editor = grapesjs.init({
  container: '#gjs',
  components: '<div class="txt-red">Hello world!</div>',
  style: '.txt-red{color: red}',
});

editor.BlockManager.add("unsubscribe-block", {
  label: "Unsubscribe",
  content: {
    type: "link",
    content: "unsubscribe_link",
    attributes: {
      href: "{unsubscribe_link}"
    }
  },
  attributes: {
    title: "Insert Unsubscribe block",
    class: "fa fa-ban",

  }
});