third party plugins

Tailwind CSS WYSIWYG Editor

WYSIWYG editors let users input and format text as it will appear in the final output, simplifying content creation with a visual interface and removing the need for direct code manipulation.

Below are the comprehensively outlined steps you can follow to seamlessly integrate Editor JS into your project. This is official EditorJS site.

  • 1
    Installation

    Install EditorJS using npm:

    npm install @editorjs/editorjs --save

  • 2
    Include EditorJS JavaScript

    Add the following <script> tag near the end of your </body> section to include EditorJS:

    <script src="../path/to/editor.js"></script>

    Note: A CDN link will not work here because customization of the default Vendor CSS is required to fit FlyonUI's design.


  • 3
    Update Tailwind Configuration

    Add the path to the EditorJS JavaScript files in the content section of your Tailwind configuration file. Also, set vendors: true in the FlyonUI config to ensure that vendor-specific CSS is generated:

    module.exports = {
      content: [
        '../path/to/editorjs/**/*.js',
      ],
      flyonui: {
        vendors: true // Enable vendor-specific CSS generation
      }
    }

  • 4
    Basic Usage

    This is a basic example of how to create an EditorJS instance:

    import EditorJS from '@editorjs/editorjs';
    
    const editor = new EditorJS({
    holder: 'editorjs', // Replace 'editorjs' with your container's id
    });

This is a basic example of a text editor using EditorJS. With EditorJS, we can create a Notion-like text editor. The text editor below includes basic tools such as heading, nested list, table, inline code, and more. For additional tools, you can refer to the EditorJS repository and check out the Awesome Editor.js list for more tools.

For images, we use the Simple Image plugin, which allows you to drag and drop images or paste the image URL directly, but no UI option will be visible in the toolbar.

This block displays the data in JSON format.

Example showcasing a text editor in a modal.