Convert Figma logo to code with AI

ckeditor logockeditor5

Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.

9,335
3,679
9,335
1,332

Top Related Projects

14,837

The world's #1 JavaScript library for rich text editing. Available for React, Vue and Angular

43,060

Quill is a modern WYSIWYG editor built for compatibility and extensibility

Super simple WYSIWYG editor

The next generation Javascript WYSIWYG HTML Editor.

Medium.com WYSIWYG editor clone. Uses contenteditable API to implement a rich text solution.

22,569

A React framework for building text editors.

Quick Overview

CKEditor 5 is a modern, feature-rich WYSIWYG editor framework. It's built with a modular architecture, allowing developers to customize and extend its functionality. CKEditor 5 focuses on creating semantically correct and accessible content, making it suitable for various web applications and content management systems.

Pros

  • Highly customizable and extensible through plugins and custom builds
  • Modern, clean UI with excellent user experience
  • Strong focus on accessibility and semantic content creation
  • Robust documentation and active community support

Cons

  • Steeper learning curve compared to simpler editors
  • Larger file size due to its comprehensive feature set
  • Some advanced features require a commercial license
  • Migration from CKEditor 4 to 5 can be challenging due to significant architectural changes

Code Examples

  1. Basic editor initialization:
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';

ClassicEditor
    .create(document.querySelector('#editor'))
    .then(editor => {
        console.log('Editor was initialized', editor);
    })
    .catch(error => {
        console.error(error);
    });
  1. Custom build with specific plugins:
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials';
import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';

ClassicEditor
    .create(document.querySelector('#editor'), {
        plugins: [Essentials, Paragraph, Bold, Italic],
        toolbar: ['bold', 'italic']
    })
    .then(editor => {
        console.log('Editor was initialized', editor);
    })
    .catch(error => {
        console.error(error);
    });
  1. Retrieving editor data:
editor.getData();

Getting Started

  1. Install CKEditor 5 via npm:
npm install --save @ckeditor/ckeditor5-build-classic
  1. Import and initialize the editor in your JavaScript file:
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';

ClassicEditor
    .create(document.querySelector('#editor'))
    .then(editor => {
        console.log('Editor was initialized', editor);
    })
    .catch(error => {
        console.error(error);
    });
  1. Add a container element in your HTML:
<div id="editor"></div>

Competitor Comparisons

14,837

The world's #1 JavaScript library for rich text editing. Available for React, Vue and Angular

Pros of TinyMCE

  • More extensive plugin ecosystem and customization options
  • Better support for older browsers and legacy systems
  • Easier integration with various frameworks and platforms

Cons of TinyMCE

  • Larger file size and potentially slower load times
  • Less modern UI design compared to CKEditor 5
  • More complex configuration process for advanced features

Code Comparison

TinyMCE initialization:

tinymce.init({
  selector: '#myTextarea',
  plugins: 'advlist autolink lists link image charmap print preview',
  toolbar: 'undo redo | formatselect | bold italic | alignleft aligncenter alignright | bullist numlist outdent indent | link image'
});

CKEditor 5 initialization:

ClassicEditor
  .create(document.querySelector('#editor'), {
    toolbar: ['heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote'],
    heading: {
      options: [
        { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
        { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' },
        { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' }
      ]
    }
  })
  .catch(error => {
    console.error(error);
  });
43,060

Quill is a modern WYSIWYG editor built for compatibility and extensibility

Pros of Quill

  • Lightweight and modular architecture, allowing for easier customization
  • Better performance with large documents due to its virtual DOM approach
  • Simpler API and easier learning curve for developers

Cons of Quill

  • Fewer built-in features compared to CKEditor 5
  • Less extensive documentation and smaller community support
  • Limited options for UI customization out of the box

Code Comparison

CKEditor 5:

ClassicEditor
    .create(document.querySelector('#editor'))
    .then(editor => {
        console.log('Editor was initialized', editor);
    })
    .catch(error => {
        console.error(error);
    });

Quill:

var quill = new Quill('#editor', {
    theme: 'snow'
});
quill.on('text-change', function(delta, oldDelta, source) {
    console.log('Editor contents changed');
});

Both editors offer easy initialization, but CKEditor 5 uses a promise-based approach, while Quill uses a more traditional object instantiation. CKEditor 5's API is more verbose, reflecting its richer feature set, while Quill's API is more concise, aligning with its lightweight nature.

Super simple WYSIWYG editor

Pros of Summernote

  • Lightweight and easy to integrate
  • Simple and intuitive user interface
  • Extensive plugin ecosystem

Cons of Summernote

  • Less robust features compared to CKEditor 5
  • Limited customization options
  • Slower development and update cycle

Code Comparison

Summernote initialization:

$('#summernote').summernote({
  height: 300,
  toolbar: [
    ['style', ['bold', 'italic', 'underline', 'clear']],
    ['font', ['strikethrough', 'superscript', 'subscript']],
    ['fontsize', ['fontsize']],
    ['color', ['color']],
    ['para', ['ul', 'ol', 'paragraph']],
    ['height', ['height']]
  ]
});

CKEditor 5 initialization:

ClassicEditor
    .create(document.querySelector('#editor'), {
        toolbar: ['heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote'],
        heading: {
            options: [
                { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
                { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' },
                { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' }
            ]
        }
    })
    .catch(error => {
        console.error(error);
    });

The next generation Javascript WYSIWYG HTML Editor.

Pros of Froala Editor

  • Lightweight and fast performance
  • Extensive customization options and API
  • Mobile-friendly with touch support

Cons of Froala Editor

  • Commercial license required for most use cases
  • Steeper learning curve for advanced customizations
  • Limited free features compared to CKEditor 5

Code Comparison

Froala Editor initialization:

new FroalaEditor('#editor', {
  toolbarButtons: ['bold', 'italic', 'underline'],
  placeholderText: 'Start typing...'
});

CKEditor 5 initialization:

ClassicEditor
  .create(document.querySelector('#editor'), {
    toolbar: ['bold', 'italic', 'underline'],
    placeholder: 'Start typing...'
  })
  .catch(error => console.error(error));

Both editors offer similar initialization processes, but CKEditor 5 uses a promise-based approach. Froala Editor provides more direct access to configuration options, while CKEditor 5 follows a modular structure.

Froala Editor focuses on simplicity and performance, making it suitable for projects requiring a lightweight solution. CKEditor 5, on the other hand, offers a more comprehensive set of features and a flexible architecture, which can be advantageous for complex editing requirements.

The choice between the two depends on specific project needs, budget constraints, and desired customization levels.

Medium.com WYSIWYG editor clone. Uses contenteditable API to implement a rich text solution.

Pros of medium-editor

  • Lightweight and minimalistic, with a smaller footprint than CKEditor 5
  • Easier to customize and extend due to its simpler architecture
  • Better suited for basic content editing tasks with less overhead

Cons of medium-editor

  • Less feature-rich compared to CKEditor 5's extensive plugin ecosystem
  • Limited built-in support for advanced formatting and content types
  • Less active development and community support in recent years

Code Comparison

medium-editor:

var editor = new MediumEditor('.editable', {
    toolbar: {
        buttons: ['bold', 'italic', 'underline', 'anchor']
    }
});

CKEditor 5:

ClassicEditor
    .create(document.querySelector('#editor'), {
        toolbar: ['bold', 'italic', 'link', 'bulletedList', 'numberedList']
    })
    .catch(error => {
        console.error(error);
    });

Both editors allow for easy initialization and basic toolbar configuration. However, CKEditor 5 offers a more robust and modular approach, with additional features and customization options available through its plugin system. medium-editor provides a simpler setup process, which can be advantageous for projects requiring basic editing functionality without the need for extensive customization.

22,569

A React framework for building text editors.

Pros of Draft.js

  • Lightweight and flexible, allowing for more customization
  • Better suited for complex, non-traditional text editing scenarios
  • Seamless integration with React applications

Cons of Draft.js

  • Steeper learning curve, especially for developers new to React
  • Less out-of-the-box features compared to CKEditor 5
  • Requires more effort to implement basic rich text editing functionality

Code Comparison

Draft.js basic implementation:

import { Editor, EditorState } from 'draft-js';

const [editorState, setEditorState] = useState(EditorState.createEmpty());

<Editor editorState={editorState} onChange={setEditorState} />

CKEditor 5 basic implementation:

import { CKEditor } from '@ckeditor/ckeditor5-react';
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';

<CKEditor
    editor={ClassicEditor}
    data="<p>Hello from CKEditor 5!</p>"
    onChange={(event, editor) => {
        const data = editor.getData();
        console.log(data);
    }}
/>

Summary

Draft.js offers more flexibility and is better suited for React applications, but requires more setup and customization. CKEditor 5 provides a more feature-rich, out-of-the-box solution for traditional rich text editing scenarios, but may be less flexible for complex, non-standard use cases. The choice between the two depends on the specific requirements of the project and the development team's expertise.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

CKEditor 5 Tweet

npm version Coverage Status CircleCI TypeScript Support

Join newsletter Follow Twitter

CKEditor 5 is a modern JavaScript rich-text editor with MVC architecture, custom data model, and virtual DOM, written from scratch in TypeScript with excellent support for modern bundlers. It provides every type of WYSIWYG editing solution imaginable with extensive collaboration support. From editors similar to Google Docs and Medium to Slack or Twitter-like applications, all is possible within a single editing framework. As a market leader, it is constantly expanded and updated.

A composition of screenshots presenting various features of CKEditor 5 rich text editor

Table of contents

Quick start

Refer to the Quick Start guide to learn more about CKEditor 5 installation.

CKEditor 5 Builder

The easiest way to start using CKEditor 5 with all the features you need is to prepare a customized setup with the CKEditor 5 Builder. All you need to do is choose the preferred editor type as a base, add all the required plugins, and download the ready-to-use package.

TypeScript support

CKEditor 5 is a TypeScript project. Starting from v37.0.0, it offers native type definitions. Check out our dedicated guide to read more about TypeScript support.

CKEditor 5 advanced installation

For more advanced users or those who need to integrate CKEditor 5 with their applications, we prepared integrations with popular JavaScript frameworks:

CKEditor 5 Framework

CKEditor 5 is also a framework for creating custom-made rich text editing solutions.

To find out how to start building your editor from scratch go to the CKEditor 5 Framework overview section of the CKEditor 5 documentation.

Documentation and FAQ

Extensive documentation dedicated to all things CKEditor 5-related is available. You will find basic guides that will help you kick off your project, advanced deep-dive tutorials to tailor the editor to your specific needs, and help sections with solutions and answers to any of your possible questions. To find out more refer to the following CKEditor 5 documentation sections:

For FAQ please go to the CKEditor Ecosystem help center. For a high-level overview of the project see the CKEditor Ecosystem website.

Releases

Follow the CKEditor 5 changelog for release details and check out the CKEditor 5 release blog posts on the CKSource blog for important release highlights and additional information.

Editing and collaboration features

The CKEditor 5 Framework offers access to a plethora of various plugins, supporting all kinds of editing features.

From collaborative editing support providing comments and tracking changes, through editing tools that let users control the content looks and structure such as tables, lists, and font styles, to accessibility helpers and multi-language support - CKEditor 5 is easily extensible and customizable. Special duty features like Markdown input and output and source editing, or export to PDF and Word provide solutions for users with diverse and specialized needs. Images and videos are easily supported and CKEditor 5 offers various upload and storage systems to manage these.

The number of options and the ease of customization and adding new ones make the editing experience even better for any environment and professional background.

Refer to the CKEditor 5 Features documentation for details.

Contributing and project organization

Ideas and discussions

The development repository of CKEditor 5 is located at https://github.com/ckeditor/ckeditor5. This is the best place for bringing opinions and contributions. Letting the core team know if they are going in the right or wrong direction is great feedback and will be much appreciated!

Development

CKEditor 5 is a modular, multi-package, monorepo project. It consists of several packages that create the editing framework, based on which the feature packages are implemented.

The ckeditor5 repository is the place that centralizes the development of CKEditor 5. It bundles different packages into a single place, adding the necessary helper tools for the development workflow, like the builder and the test runner. Basic information on how to set up the development environment can be found in the documentation.

See the official contributors' guide to learn how to contribute your code to the project.

Reporting issues and feature requests

Report issues in the ckeditor5 repository. Read more in the Getting support section of the CKEditor 5 documentation.

License

Licensed under the terms of GNU General Public License Version 2 or later. For full details about the license, please check the LICENSE.md file or https://ckeditor.com/legal/ckeditor-oss-license.

NPM DownloadsLast 30 Days