CKEditor 5 Rich Text Editor

48.0.0 · active · verified Sun Apr 19

CKEditor 5 is a modern, highly extensible rich text editor framework designed for building custom WYSIWYG editing experiences, with a strong emphasis on real-time collaborative editing. It is not a single product but a collection of features, plugins, and builds that can be combined. The current stable major version is v48.0.0, released in April 2026. However, v47.x is designated as the Long-term Support (LTS) edition for licensed customers, receiving security and compatibility fixes, while v48.x introduces new features and significant updates. CKEditor 5 is characterized by its MVC architecture, custom data model, and support for operational transformation (OT) to power real-time collaboration. It typically follows a regular release cadence for minor and patch versions, with major versions introducing significant architectural changes or deprecations, requiring users to stay updated with release notes. Its modular design allows developers to create highly customized editor instances tailored to specific application needs, ranging from simple document editors to complex collaborative writing environments.

Common errors

Warnings

Install

Imports

Quickstart

Initializes a `ClassicEditor` instance on a DOM element with basic toolbar configuration, demonstrating a common setup for rich text editing.

import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
import type { EditorConfig } from '@ckeditor/ckeditor5-core';

// This is a minimal example. In a real application, you might use a framework component.
// Ensure a div with id="editor" exists in your HTML.

// Example CKEditor 5 configuration
const editorConfiguration: EditorConfig = {
    toolbar: [ 'heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote', '|', 'undo', 'redo' ],
    language: 'en',
    // Example of a potentially sensitive configuration, though basic editor doesn't need it.
    // For LTS versions or specific features (like AI), a license key might be required.
    // process.env.CKEDITOR_LICENSE_KEY is illustrative.
    licenseKey: process.env.CKEDITOR_LICENSE_KEY ?? '' // Example: For LTS or specific premium features
};

document.addEventListener('DOMContentLoaded', () => {
    const editorElement = document.querySelector('#editor');

    if (editorElement) {
        ClassicEditor
            .create( editorElement, editorConfiguration )
            .then( editor => {
                console.log( 'Editor was initialized', editor );
                // Access editor data: editor.getData();
            })
            .catch( error => {
                console.error( 'There was a problem initializing the editor.', error );
            });
    } else {
        console.error('Editor target element #editor not found.');
    }
});

view raw JSON →