What is ckeditor5?
CKEditor 5 is a modern JavaScript rich text editor with a modular architecture. It offers a wide range of features and is highly customizable, making it suitable for various types of content editing needs.
What are ckeditor5's main functionalities?
Basic Text Editing
This code initializes a basic CKEditor 5 instance with classic build, allowing users to perform basic text editing tasks such as bold, italic, and underline.
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);
});
Custom Plugins
This code demonstrates how to initialize CKEditor 5 with custom plugins. In this example, only the Bold and Italic plugins are included, and the toolbar is customized to show only these options.
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials';
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, Bold, Italic],
toolbar: ['bold', 'italic']
})
.then(editor => {
console.log('Editor was initialized with custom plugins', editor);
})
.catch(error => {
console.error(error);
});
Real-time Collaboration
This code initializes CKEditor 5 with real-time collaboration features, allowing multiple users to edit the same document simultaneously and see each other's changes in real-time.
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
import RealTimeCollaborativeEditing from '@ckeditor/ckeditor5-real-time-collaboration/src/realtimecollaborativeediting';
import RealTimeCollaborativeComments from '@ckeditor/ckeditor5-real-time-collaboration/src/realtimecollaborativecomments';
ClassicEditor.create(document.querySelector('#editor'), {
plugins: [RealTimeCollaborativeEditing, RealTimeCollaborativeComments],
toolbar: ['comment', 'trackChanges']
})
.then(editor => {
console.log('Editor was initialized with real-time collaboration', editor);
})
.catch(error => {
console.error(error);
});
Other packages similar to ckeditor5
tinymce
TinyMCE is another popular rich text editor that offers a wide range of features and customization options. It is known for its ease of integration and extensive plugin library. Compared to CKEditor 5, TinyMCE has a more traditional architecture but offers similar functionalities.
quill
Quill is a lightweight, open-source rich text editor with a focus on simplicity and extensibility. It provides a clean API and is highly customizable. While it may not have as many built-in features as CKEditor 5, it is a good choice for projects that require a simple and flexible editor.
draft-js
Draft.js is a rich text editor framework for React, developed by Facebook. It provides a lot of flexibility and control over the editor's behavior and appearance. Unlike CKEditor 5, which is a complete solution, Draft.js is more of a toolkit for building custom editors.
CKEditor 5
A set of ready-to-use rich text editors created with a powerful framework. Made with real-time collaborative editing in mind.
⚠ This package does not contain any source code
CKEditor 5 is distributed as four ready-to-use builds which you can install from npm.
You can also customize the existing builds or build your own editors and features by using the CKEditor 5 Framework.
Table of contents
Quick start
CKEditor 5 Builds
CKEditor 5 Builds are a set of ready-to-use rich text editors. Every "build" provides a single type of editor with a set of features and a default configuration.
The following CKEditor 5 Builds are currently available:
Example
Creating an editor using a CKEditor 5 build is very simple and can be described in two steps:
- Load the desired editor via the
<script>
tag. - Call the static
create()
method to create the editor.
In your HTML page add an element that CKEditor should replace:
<textarea name="content" id="editor"></textarea>
Load the classic editor build (you can choose between CDN, npm and zip downloads):
<script src="https://cdn.ckeditor.com/ckeditor5/<version>/classic/ckeditor.js"></script>
Call the ClassicEditor.create()
method:
<script>
ClassicEditor
.create( document.querySelector( '#editor' ) )
.catch( error => {
console.error( error );
} );
</script>
You’re ready to go!
To find out how to start with other builds check the Quick start guide in the CKEditor 5 documentation.
CKEditor 5 Framework
CKEditor 5 Builds allow you to quickly and easily initialize one of the many types of editors in your application. At the same time, CKEditor 5 is also a framework for creating custom-made rich text editing solutions.
To find out how to start building your own editor from scratch go to CKEditor 5 Framework overview section of CKEditor 5 documentation.
Documentation and FAQ
To find out more see the following CKEditor 5 documentation sections:
The documentation is far from being complete and will be constantly evolving (as will the editor) until it is ready for v1.0.0.
For FAQ please go to the CKEditor Ecosystem help center.
For a high-level overview of the project see the CKEditor Ecosystem website.
Contributing and project organization
Ideas and discussions
The main 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, multi-repository 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.
Reporting issues and feature requests
Each repository handles its issues independently. However, it is recommended to report issues in this repository unless you know to which specific repository the issue belongs.
Read more on the Support page.
Releases
See CKEditor 5 release blog posts on the CKEditor blog.
Packages
Core libraries
Builds
Features
Editors
Themes
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.