10+ React Rich Text Editors
Published: 2021-11-07 09:07:58

### Slate - A completely customizable framework for building rich text editors. 
Slate lets you build rich, intuitive editors like those in Medium, Dropbox Paper or Google Docs—which are becoming table stakes for applications on the web—without your codebase getting mired in complexity.

- **The editor's "schema" was hardcoded and hard to customize**. Things like bold and italic were supported out of the box, but what about comments, or embeds, or even more domain-specific needs?

- **Transforming the documents programmatically was very convoluted**. Writing as a user may have worked, but making programmatic changes, which is critical for building advanced behaviors, was needlessly complex.

- **Serializing to HTML, Markdown, etc. seemed like an afterthought**. Simple things like transforming a document to HTML or Markdown involved writing lots of boilerplate code, for what seemed like very common use cases.

- **Re-inventing the view layer seemed inefficient and limiting**. Most editors rolled their own views, instead of using existing technologies like React, so you have to learn a whole new system with new "gotchas".

- **Collaborative editing wasn't designed for in advance**. Often the editor's internal representation of data made it impossible to use to for a realtime, collaborative editing use case without basically rewriting the editor.

- **The repositories were monolithic, not small and reusable**. The code bases for many of the editors often didn't expose the internal tooling that could have been re-used by developers, leading to having to reinvent the wheel.

- **Building complex, nested documents was impossible**. Many editors were designed around simplistic "flat" documents, making things like tables, embeds and captions difficult to reason about and sometimes impossible.
![Slate](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qmdboiutmgputktx0w2s.png)
[Demo](http://slatejs.org/)  [GitHub](https://github.com/ianstormtaylor/slate)

### Draft.js - a React framework for building text editors. 
Draft.js is a JavaScript rich text editor framework, built for React and backed by an immutable model.

- **Extensible and Customizable:** We provide the building blocks to enable the creation of a broad variety of rich text composition experiences, from basic text styles to embedded media.
- **Declarative Rich Text:** Draft.js fits seamlessly into React applications, abstracting away the details of rendering, selection, and input behavior with a familiar declarative API.
- **Immutable Editor State: ** The Draft.js model is built with immutable-js, offering an API with functional state updates and aggressively leveraging data persistence for scalable memory usage. 
![Draft.js](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lvuas58tc0kh91w7z1gf.gif)
[Demo](https://draftjs.org/)  [GitHub](https://github.com/facebook/draft-js)

### React Draft Wysiwyg
A Wysiwyg editor built using ReactJS and DraftJS libraries.

-     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.

![](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wnsm8b3jghr1op4vmzpv.gif)
 [Demo](https://jpuri.github.io/react-draft-wysiwyg)  [GitHub](https://github.com/jpuri/react-draft-wysiwyg)

### Quill Rich Text Editor
Quill is a free, open source WYSIWYG editor built for the modern web. With its extensible architecture and a expressive API you can completely customize it to fulfill your needs. Some built in features include:

-     Fast and lightweight
-     Semantic markup
-     Standardized HTML between browsers
-     Cross browser support including Chrome, Firefox, Safari, and IE 9+
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ocxp5wtbml06q9da55ns.png)

 [Demo](https://zenoamaro.github.io/react-quill/)  [GitHub](https://github.com/zenoamaro/react-quill)

### React Email Editor
 Drag-n-Drop Email Editor Component for React.js.The excellent drag-n-drop email editor by Unlayer as a React.js wrapper component. This is the most powerful and developer friendly visual email builder for your app.


-     editorId String HTML div id of the container where the editor will be embedded (optional)
-     style Object style object for the editor container (default {})
-     minHeight String minimum height to initialize the editor with (default 500px)
-     onLoad Function called when the editor instance is created
-     onReady Function called when the editor has finished loading
-     options Object options passed to the Unlayer editor instance (default {})
-     tools Object configuration for the built-in and custom tools (default {})
-     appearance Object configuration for appearance and theme (default {})
-     projectId Integer Unlayer project ID (optional)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wf74igyarb6c65o9txig.png)

 [Demo](http://react-email-editor-demo.netlify.com/)  [GitHub](https://github.com/unlayer/react-email-editor)

### Monaco Editor for React 
 Monaco Editor for React - use the monaco-editor in any React application without needing to use webpack (or rollup/parcel/etc) configuration files / plugins .

Besides types, the library exports Editorand DiffEditor components, as well as the loader utility and the useMonaco hook:

`import Editor, { DiffEditor, useMonaco, loader } from "@monaco-editor/react";
`


 [Demo](https://monaco-react.surenatoyan.com/)  [GitHub](https://github.com/suren-atoyan/monaco-react)

### Alloy Editor
 Alloy Editor is a modern WYSIWYG editor built on top of CKEditor, designed to create modern and gorgeous web content.


-     Smart toolbars appear right near the selected text and offer different functionality based on context
-     Easily add your own buttons (see the "marquee" example in the docs)
-     Paste images from clipboard, or Drag&Drop them from another application
-     Insert images from the device's camera!
-     Paste rich text from any web page and preserve its formatting
-     The full styling power of CKEditor...
-     ...with a much more modern UI
-     The core is fully separated from the UI
-     The example UI is built with React
-     Plugin architecture

![Alloy Editor](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rx6zs1ifmv20png58ll4.png)
 [Demo](http://alloyeditor.com/)  [GitHub](https://github.com/liferay/alloy-editor)

### react-contenteditable
React component for a div with editable contents.
```javascript
import React from 'react'
import ContentEditable from 'react-contenteditable'

class MyComponent extends React.Component {
  constructor() {
    super()
    this.contentEditable = React.createRef();
    this.state = {html: "<b>Hello <i>World</i></b>"};
  };

  handleChange = evt => {
    this.setState({html: evt.target.value});
  };

  render = () => {
    return <ContentEditable
              innerRef={this.contentEditable}
              html={this.state.html} // innerHTML of the editable div
              disabled={false}       // use true to disable editing
              onChange={this.handleChange} // handle innerHTML change
              tagName='article' // Use a custom HTML tag (uses a div by default)
            />
  };
};
```
 [Demo](https://codesandbox.io/s/l91xvkox9l)  [GitHub](https://github.com/lovasoa/react-contenteditable)
### Megadraft -A Rich Text editor 
 Megadraft is a Rich Text editor built on top of Facebook's Draft.JS featuring a nice default base of components and extensibility.
 ```javascript
import React from "react";
import ReactDOM from "react-dom";
import {MegadraftEditor, editorStateFromRaw} from "megadraft";

//Import megadraft.css
import 'megadraft/dist/css/megadraft.css'

class App extends React.Component {
  constructor(props) {
    super(props);
    this.state = {editorState: editorStateFromRaw(null)};
  }

  onChange = (editorState) => {
    this.setState({editorState});
  }

  render() {
    return (
      //Add some margin left to show plugins sidebar
      <div style={{marginLeft: 80}}>
        <MegadraftEditor
          editorState={this.state.editorState}
          onChange={this.onChange}
          placeholder='Add some text'/>
      </div>
    )
  }
}

ReactDOM.render(
  <App />,
  document.getElementById('container')
);
```
 [Demo](http://megadraft.io/)  [GitHub](https://github.com/globocom/megadraft)


### react-web-editor
  The react-web-editor is a WYSIWYG editor library. you can resize and drag your component. It also has simple rich text editor.
-  The React Web editor is a library that provides and hooks of components that can dynamically change ui.

- It supports features like Resizing, Draggable, and Drag and Drop, You can also upload a image dynamically, and styling component's color and text.

- The coordinates tag, which shows where the current components are located, and the guide line, which tells you if the current components are centralized, are built into the block-type components.

- Ultimatly, You can make a editor page which can change web's UI dynamically.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/clbrh6gcumb1shg7evje.gif)
 [Demo](https://reactwebeditor.com/)  [GitHub](https://github.com/CHEWCHEWW/react-web-editor)

### Tiptap
  A headless, framework-agnostic and extendable rich text editor, based on ProseMirror.
![react-web-editor](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o1ijqwtebvgo78o9znxv.png)

 [Demo](https://www.tiptap.dev/examples)  [GitHub](https://github.com/ueberdosis/tiptap)



#### Source: [bestofreactjs.com](https://bestofreactjs.com)