react-draft-wysiwyg vs react-froala-wysiwyg vs react-quill
Rich Text Editors for React
react-draft-wysiwygreact-froala-wysiwygreact-quillSimilar Packages:

Rich Text Editors for React

Rich Text Editors for React are components that allow users to create and edit formatted text within a web application. These editors provide a WYSIWYG (What You See Is What You Get) interface, enabling users to style text, insert images, create lists, and perform other formatting tasks directly within the editor. They are commonly used in content management systems, blogging platforms, and any application that requires text input with rich formatting capabilities. Popular React rich text editor libraries include react-draft-wysiwyg, react-froala-wysiwyg, and react-quill, each offering unique features and customization options to suit different use cases.

Npm Package Weekly Downloads Trend

3 Years

Github Stars Ranking

Stat Detail

Package
Downloads
Stars
Size
Issues
Publish
License
react-draft-wysiwyg06,482299 kB754-MIT
react-froala-wysiwyg0579256 kB17617 days agoMIT
react-quill07,024405 kB431-MIT

Feature Comparison: react-draft-wysiwyg vs react-froala-wysiwyg vs react-quill

Customization

  • react-draft-wysiwyg:

    react-draft-wysiwyg offers extensive customization options, allowing developers to create custom toolbars, buttons, and even integrate third-party plugins. Its architecture is designed to be flexible, making it easy to modify the editor's appearance and functionality to fit specific needs.

  • react-froala-wysiwyg:

    react-froala-wysiwyg provides a highly customizable editor with a wide range of built-in features and the ability to create custom plugins. It includes a visual editor for designing toolbars and supports real-time collaboration, making it suitable for applications that require advanced customization and interactivity.

  • react-quill:

    react-quill allows for customization of the toolbar and editor components, and it supports the creation of custom formats and modules. While it is not as feature-rich in terms of built-in customization options as Froala, it is lightweight and easy to extend, making it a good choice for projects that prioritize simplicity and flexibility.

Licensing

  • react-draft-wysiwyg:

    react-draft-wysiwyg is an open-source library licensed under the MIT License, which allows for free use, modification, and distribution. This makes it a great choice for both personal and commercial projects without any licensing fees.

  • react-froala-wysiwyg:

    react-froala-wysiwyg is based on the Froala Editor, which is a commercial product. While the editor offers a free version with limited features, a paid license is required to unlock the full functionality. This is important to consider for projects with budget constraints.

  • react-quill:

    react-quill is an open-source project licensed under the MIT License. It is free to use for both personal and commercial projects, making it a cost-effective choice for developers and organizations.

Image Handling

  • react-draft-wysiwyg:

    react-draft-wysiwyg provides basic image handling capabilities, including image uploads and embedding images via URLs. However, it does not include advanced image editing features out of the box, which can be added through custom implementations or third-party plugins.

  • react-froala-wysiwyg:

    react-froala-wysiwyg excels in image handling, offering built-in image uploads, drag-and-drop support, and a rich set of image editing tools, including resizing, cropping, and applying filters. This makes it one of the most feature-complete editors for handling images directly within the editor interface.

  • react-quill:

    react-quill supports image uploads and embedding, but it requires additional configuration to handle file uploads. The editor is designed to be extensible, so developers can implement custom image upload handlers and integrate third-party image management solutions as needed.

Code Example

  • react-draft-wysiwyg:

    Basic Usage of react-draft-wysiwyg

    import React, { useState } from 'react';
    import { Editor } from 'react-draft-wysiwyg';
    import 'react-draft-wysiwyg/dist/react-draft-wysiwyg.css';
    import { convertToRaw, EditorState } from 'draft-js';
    import { stateToHTML } from 'draft-js-export-html';
    
    const MyEditor = () => {
      const [editorState, setEditorState] = useState(EditorState.createEmpty());
    
      const handleEditorStateChange = (state) => {
        setEditorState(state);
      };
    
      const handleSave = () => {
        const content = convertToRaw(editorState.getCurrentContent());
        const html = stateToHTML(editorState.getCurrentContent());
        console.log('Content as HTML:', html);
        console.log('Content as Raw:', content);
      };
    
      return (
        <div>
          <Editor
            editorState={editorState}
            onEditorStateChange={handleEditorStateChange}
            toolbar={{
              options: ['inline', 'block', 'list', 'link', 'image', 'history'],
            }}
          />
          <button onClick={handleSave}>Save</button>
        </div>
      );
    };
    
    export default MyEditor;
    
  • react-froala-wysiwyg:

    Basic Usage of react-froala-wysiwyg

    import React from 'react';
    import ReactFroalaWysiwyg from 'react-froala-wysiwyg';
    import 'froala-editor/js/froala_editor.pkgd.min.js';
    import 'froala-editor/css/froala_editor.pkgd.min.css';
    import 'froala-editor/css/froala_style.min.css';
    
    const MyFroalaEditor = () => {
      const handleModelChange = (content) => {
        console.log('Editor content:', content);
      };
    
      return (
        <div>
          <ReactFroalaWysiwyg
            tag='textarea'
            model={content}
            onModelChange={handleModelChange}
            config={{
              toolbarButtons: ['bold', 'italic', 'underline', 'insertImage', 'insertLink'],
            }}
          />
        </div>
      );
    };
    
    export default MyFroalaEditor;
    
  • react-quill:

    Basic Usage of react-quill

    import React, { useState } from 'react';
    import ReactQuill from 'react-quill';
    import 'react-quill/dist/quill.snow.css';
    
    const MyQuillEditor = () => {
      const [editorHtml, setEditorHtml] = useState('');
    
      const handleChange = (html) => {
        setEditorHtml(html);
        console.log('Editor content:', html);
      };
    
      return (
        <div>
          <ReactQuill value={editorHtml} onChange={handleChange} />
        </div>
      );
    };
    
    export default MyQuillEditor;
    

How to Choose: react-draft-wysiwyg vs react-froala-wysiwyg vs react-quill

  • react-draft-wysiwyg:

    Choose react-draft-wysiwyg if you need a highly customizable editor built on top of Draft.js, with good support for plugins and a focus on performance. It is ideal for applications that require a lightweight editor with a modular architecture.

  • react-froala-wysiwyg:

    Choose react-froala-wysiwyg if you need a feature-rich editor with a modern design, built-in image editing, and excellent support for mobile devices. It is suitable for applications that require advanced editing features out of the box and are willing to pay for a commercial license for full functionality.

  • react-quill:

    Choose react-quill if you need a simple, open-source editor with a clean API and good support for custom themes and formats. It is ideal for projects that require a straightforward editor with extensibility options and a focus on simplicity.

README for react-draft-wysiwyg

React Draft Wysiwyg

A Wysiwyg editor built using ReactJS and DraftJS libraries. Demo Page.

Build Status

Features

  • Configurable toolbar with option to add/remove controls.
  • Option to change the order of the controls in the toolbar.
  • Option to add custom controls to the toolbar.
  • Option to change styles and icons in the toolbar.
  • Option to show toolbar only when editor is focused.
  • Support for inline styles: Bold, Italic, Underline, StrikeThrough, Code, Subscript, Superscript.
  • Support for block types: Paragraph, H1 - H6, Blockquote, Code.
  • Support for setting font-size and font-family.
  • Support for ordered / unordered lists and indenting.
  • Support for text-alignment.
  • Support for coloring text or background.
  • Support for adding / editing links
  • Choice of more than 150 emojis.
  • Support for mentions.
  • Support for hashtags.
  • Support for adding / uploading images.
  • Support for aligning images, setting height, width.
  • Support for Embedded links, flexibility to set height and width.
  • Option provided to remove added styling.
  • Option of undo and redo.
  • Configurable behavior for RTL and Spellcheck.
  • Support for placeholder.
  • Support for WAI-ARIA Support attributes
  • Using editor as controlled or un-controlled React component.
  • Support to convert Editor Content to HTML, JSON, Markdown.
  • Support to convert the HTML generated by the editor back to editor content.
  • Support for internationalization.

Installing

The package can be installed from npm react-draft-wysiwyg

$ npm install --save react-draft-wysiwyg draft-js

Getting started

Editor can be used as simple React Component:

import { Editor } from "react-draft-wysiwyg";
import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css";
<Editor
  editorState={editorState}
  toolbarClassName="toolbarClassName"
  wrapperClassName="wrapperClassName"
  editorClassName="editorClassName"
  onEditorStateChange={this.onEditorStateChange}
/>;

Docs

For more documentation check here.

Questions Discussions

For discussions join public channel #rd_wysiwyg in DraftJS Slack Organization.

Fund

You can fund project at Patreon.

Thanks

Original motivation and sponsorship for this work came from iPaoo. I am thankful to them for allowing the Editor to be open-sourced.

License

MIT.