
Support for coloring text or background.Support for ordered / unordered lists and indenting.Support for setting font-size and font-family.Support for block types: Paragraph, H1 - H6, Blockquote, Code.Support for inline styles: Bold, Italic, Underline, StrikeThrough, Code, Subscript, Superscript.Option to show toolbar only when editor is focused.Option to change styles and icons in the toolbar.Option to add custom controls to the toolbar.Option to change the order of the controls in the toolbar.Configurable toolbar with option to add/remove controls.* 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.Ī Wysiwyg editor built using ReactJS and DraftJS libraries.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.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.Many editors were designed around simplistic "flat" documents, making things like tables, embeds and captions difficult to reason about and sometimes impossible.ĭraft.js - a React framework for building text editors.ĭraft.js is a JavaScript rich text editor framework, built for React and backed by an immutable model.
#Free rich text editor code
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.īuilding complex, nested documents was impossible. The repositories were monolithic, not small and reusable. 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. 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".Ĭollaborative editing wasn't designed for in advance. Re-inventing the view layer seemed inefficient and limiting. Simple things like transforming a document to HTML or Markdown involved writing lots of boilerplate code, for what seemed like very common use cases. Writing as a user may have worked, but making programmatic changes, which is critical for building advanced behaviors, was needlessly complex. Transforming the documents programmatically was very convoluted.

Things like bold and italic were supported out of the box, but what about comments, or embeds, or even more domain-specific needs?

The editor's "schema" was hardcoded and hard to customize. 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. Slate - A completely customizable framework for building rich text editors.
